/* ==========================================================================
   refonte.css — surcharge d'apparence (chargée en dernier)
   Attention Réversible : il faut retirer le lien dans head.php et tout revient comme avant
   ========================================================================== */

body { -webkit-font-smoothing: antialiased; }

#content {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(16,32,54,.06), 0 6px 20px rgba(16,32,54,.07);
    padding: 4px 0 8px;
    margin: 14px 15px 14px 0;
    overflow: hidden;
}

/* --------------------------------------------------------------------------
   Onglets à plat, pleine largeur, sous le menu déroulant
   -------------------------------------------------------------------------- */
.gauche_bandeau,
.gauche_bandeau_dsh_pgid,
.gauche_bandeau_numerique,
.gauche_bandeau_admin,
.gauche_bandeau_campagne { height: auto !important; }
#nav-onglet { clear: both; height: auto; padding-top: 6px; }
div.navigation-onglet {
    float: none !important;             /* !important : gagne même si une CSS numérique se charge après (AJAX) */
    width: 100% !important;
    height: auto !important;
}
div.navigation-onglet.onglets-dsh-pgid { margin-left: 0 !important; }  /* neutralise l'offset 150px */
div.navigation-onglet ul {
    display: flex !important;
    flex-wrap: wrap;
    justify-content: flex-start;        /* onglets alignés à gauche */
    align-items: center;                /* centre verticalement les libellés */
    height: auto !important;
    border: none !important;
    border-bottom: 1px solid #e4e8ee !important;   /* ligne de base continue */
}
div.navigation-onglet li,
div.navigation-onglet li.onglet_deux_lignes {
    width: auto !important;
    height: auto !important;
    line-height: 1.25;
    white-space: nowrap;                /* 1 seule ligne */
    padding: 12px 14px !important;
    border: none !important;            /* !important : bat onglet-adh-numerique.css chargé après */
    border-bottom: 3px solid transparent !important;
    margin-bottom: -1px;
    background: none !important;
    color: #5a6b7f !important;
    font-size: 13px;
    font-weight: 600;
}

div.navigation-onglet li a {
    color: inherit;
    text-decoration: none;
    font-weight: inherit;
}
div.navigation-onglet li:hover,
div.navigation-onglet li.onglet_deux_lignes:hover {
    height: auto;
    background: none !important;
    color: #004074 !important;         /* survol subtil : juste le texte marine + trait discret */
    border-bottom-color: #cbd9e8 !important;
}
div.navigation-onglet li.select,
div.navigation-onglet li.onglet_deux_lignes.select {
    height: auto;
    background: none !important;        /* bat le fond bleu #356EB9 de onglet-adh-numerique.css */
    color: #004074 !important;
    font-weight: 700;
    border-bottom-color: #004074 !important;
}

/* --------------------------------------------------------------------------
   Onglets ÉDITEUR  comme les autres
   -------------------------------------------------------------------------- */
div.navigation-onglet li.li_transition,
div.navigation-onglet li.dernier_onglet { display: none !important; }

.navigation-onglet .arrow_box:before,
.navigation-onglet .arrow_box:after,
.navigation-onglet .premier_onglet:before,
.navigation-onglet .premier_onglet:after {
    content: none !important;
    display: none !important;
    border: none !important;
}

div.navigation-onglet li.li_onglet,
div.navigation-onglet li.premier_onglet {
    padding: 12px 14px !important;
    background: none !important;
    border: none !important;
    border-bottom: 3px solid transparent !important;
    height: auto !important;
    line-height: 1.25 !important;
    color: #5a6b7f !important;
}
div.navigation-onglet li.li_onglet a,
div.navigation-onglet li.premier_onglet a { color: inherit; text-decoration: none; }
div.navigation-onglet li.li_onglet:hover,
div.navigation-onglet li.premier_onglet:hover {
    color: #004074 !important;
    border-bottom-color: #cbd9e8 !important;
}
div.navigation-onglet li.li_onglet.select,
div.navigation-onglet li.premier_onglet.select {
    background: none !important;
    color: #004074 !important;
    border-bottom-color: #004074 !important;
    font-weight: 700;
}
div.navigation-onglet li.li_onglet.onglet_inactif,
div.navigation-onglet li.premier_onglet.onglet_inactif {
    background: none !important;
    color: #b0bac6 !important;
}

/* --------------------------------------------------------------------------
   Bandeau dossier : fil d'Ariane + titre
   -------------------------------------------------------------------------- */
#chemin ul { list-style: none; margin: 0; padding: 0; }
#chemin li { color: #8a99ab; font-size: 13px; }
#chemin a { color: #5a6b7f; }
#chemin a:hover { color: #2196f3; }

.nom_intervenant {
    color: #004074;
    font-weight: 700;
    letter-spacing: .2px;
}
.sous_titre a.lien_bleu { color: #2196f3; font-weight: 600; }

/* --------------------------------------------------------------------------
   Sidebar des rubriques (#rubrique) — aérée, coins arrondis
   Les icônes de statut (vert/orange) restent gérées par le CSS existant
   -------------------------------------------------------------------------- */
#rubrique li.decalage-rubrique {
    border-radius: 8px;
    margin: 2px 6px;
    transition: background-color .12s ease;
}
#rubrique li.decalage-rubrique:hover {
    background-color: #eef3f8;
    color: #004074;
}
#rubrique li.select,
div#rubrique li.rubrique_validee.select,
div#rubrique li.rubrique_en_attente.select {
    border-radius: 8px;
    background-color: #004074;
    color: #ffffff;
}

/* Liste d'états */
div#rubrique li.selectable {
    width: auto;
    padding-left: 12px;
    padding-right: 8px;
    font-size: 12px;
    white-space: nowrap;
    border-radius: 8px;
    margin: 2px 6px;
}
div#rubrique li.selectable:hover {
    background-color: #eef3f8;
    color: #004074;
}

/* --------------------------------------------------------------------------
   Spinner « Veuillez patientez » — carte blanche au lieu du rose
   -------------------------------------------------------------------------- */
#Loading {
    width: auto !important;
    background-color: #ffffff !important;
    border: 1px solid #e4e8ee;
    border-radius: 10px;
    box-shadow: 0 4px 16px rgba(16,32,54,.14);
    padding: 4px 8px;
}
#Loading table, #Loading td { background: transparent !important; }
#Loading p { color: #5a6b7f; font-weight: 600; margin: 0; }
#LoadingBg, .DisabledZone { background-color: #1f2b3a !important; opacity: .12 !important; }

/* --------------------------------------------------------------------------
   Pied de page
   -------------------------------------------------------------------------- */
#footer {
    background-color: #ffffff !important;
    border-top: 1px solid #e4e8ee;
    color: #8a99ab;
}
#footer a { color: #5a6b7f; }
#footer a:hover { color: #2196f3; }

/* --------------------------------------------------------------------------
   Tableaux de liste (.liste / .dossiers / DataTables) — modernisés
   -------------------------------------------------------------------------- */
table.liste th,
table.dossiers th,
table.dataTable thead th {
    background-color: #eef2f7 !important;    /* avant : #666666 gris plat */
    color: #33475b !important;
    border-bottom: 1px solid #d8e0ea !important;
    font-weight: 700;
}
table.liste td,
table.dossiers td,
table.dataTable td,
table.dataTable th {
    border-color: #eef1f5 !important;
}
table.liste tbody tr:hover > td,
table.dossiers tbody tr:hover > td,
table.dataTable tbody tr:hover > * {
    background: #f5f9fd;
}
/* Champs de recherche/pagination DataTables arrondis */
.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
    border: 1px solid #dce3ec;
    border-radius: 8px;
    padding: 6px 10px;
}
/* Icônes Font Awesome (export, actions) : couleur de marque + survol */
.dt-buttons .fa,
table.liste .fa,
table.dossiers .fa { color: #2196f3; }
.dt-buttons button:hover .fa { color: #004074; }
/* Boutons d'export DataTables arrondis */
.dt-buttons button.dt-button {
    border: 1px solid #dce3ec !important;
    border-radius: 8px !important;
    background: #ffffff !important;
}

/* Badge date rouge  */
td.rougeNegativeFond span {
    background-color: #fdecec !important;
    color: #c0392b !important;
    padding: 3px 9px !important;
    border-radius: 999px !important;
    font-weight: 600;
}

/* --------------------------------------------------------------------------
   Blocs d'état FT / DS / PJ / PP (span.transmission_*) — pastilles arrondies
   -------------------------------------------------------------------------- */
span.transmission_ok,
span.transmission_partielle,
span.transmission_nok {
    display: inline-block;
    font-size: 12px !important;
    font-weight: 700;
    padding: 3px 7px !important;
    margin-right: 4px !important;
    min-width: 24px;
    text-align: center;
    border-radius: 6px;
    letter-spacing: .3px;
    line-height: 1.2;
}
.transmission_ok        { background-color: #22a06b !important; }  /* vert adouci */
.transmission_partielle { background-color: #e6a23c !important; }  /* ambre */
.transmission_nok       { background-color: #e05252 !important; }  /* rouge moins agressif */

/* --------------------------------------------------------------------------
   Composants de formulaire — selects, champs, barres, badge échéance
   -------------------------------------------------------------------------- */
/* Menus déroulants (standalone) */
#content select {
    border: 1px solid #dce3ec !important;
    border-radius: 8px !important;
    padding: 6px 10px !important;
    background-color: #ffffff;
    color: #1f2b3a;
    height: auto;
}
/* Champs texte / zones de texte */
#content input[type="text"],
#content input[type="password"],
#content input[type="email"],
#content input[type="number"],
#content textarea {
    border: 1px solid #dce3ec !important;
    border-radius: 6px !important;
    background-color: #ffffff;
}
/* EXCEPTION : champs dans un tableau (grilles de saisie denses type DSH) -> pas d'encadré/arrondi */
#content table input[type="text"],
#content table input[type="number"] {
    border: none !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}
#content select:focus,
#content input:focus,
#content textarea:focus {
    outline: none;
    border-color: #2196f3 !important;
    box-shadow: 0 0 0 3px rgba(33,150,243,.15);
}

/* Barres de progression « Avancement » : coins arrondis */
#content progress {
    border-radius: 6px;
    overflow: hidden;
}
#content progress::-webkit-progress-bar { border-radius: 6px; }
#content progress::-webkit-progress-value { border-radius: 6px; }
/* Piste (gris) ET remplissage coloré (:after) arrondis → plus de bouts carrés */
#content .barre, #content div.progress_petit, #content div.progress_moyen { border-radius: 6px; }
#content .barre:after,
#content .barre_petit:after,
#content .barre_moyen:after { border-radius: 6px; }
/* Style fin & moderne : piste plus claire, barres moins hautes, texte ajusté
   (couleurs de remplissage orange/vert conservées) */
#content .barre { background: #e9edf2 !important; height: 14px !important; }
#content div.progress_text { height: 14px !important; line-height: 14px !important; font-size: 11px !important; }

/* Badge « Date d'échéance » : encadré orange adouci + arrondi */
div#date_echeance p,
div#date_echeance_controle p {
    border-radius: 999px;
}

/* --------------------------------------------------------------------------
   Navigation dossier précédent / suivant (#contenu_prev_next)
   -------------------------------------------------------------------------- */
#contenu_prev_next a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #2196f3;
    text-decoration: none;
    font-weight: 600;
    font-size: 13px;
}
#contenu_prev_next a:hover {
    color: #004074;
    text-decoration: none;
}
#contenu_prev_next a .fa { font-size: 12px; }

/* Chevrons déplacés autour du titre (presse) : ‹ prev  [TITRE]  next › */
.dossier-titre-row {
    display: flex;
    align-items: center;
    gap: 14px;
}
.dossier-titre-row a.dossier-nav {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #2196f3;
    text-decoration: none;
    font-weight: 600;
    font-size: 13px;
    white-space: nowrap;
}
.dossier-titre-row a.dossier-nav:hover { color: #004074; }
.dossier-titre-row a.dossier-nav .fa { font-size: 12px; }

/* --------------------------------------------------------------------------
   Actions bandeau : DSH / Projet de PV (icône PDF) + bulle (échange)
   On masque les icônes PNG et on passe aux icônes Font Awesome
   -------------------------------------------------------------------------- */
div.button-action { height: auto; }
div.button-action ul { height: auto; display: flex; gap: 8px; align-items: center; }

div.button-action li.pdf_voir,
div.button-action li.pdf_inactif,
div.button-action li.ajouter_echange {
    width: auto !important;
    height: 30px !important;                /* hauteur compacte fixe -> ne déborde plus sur les onglets */
    display: flex !important;
    align-items: center !important;
    background: none !important;            /* enlève l'icône PNG */
    border: 1px solid #dce3ec !important;
    border-radius: 8px !important;
    text-align: left !important;
    padding: 0 10px !important;
}
/* Case vide dans la barre d'actions -> masquée (évite le "rond" vide) */
div.button-action li:empty { display: none !important; }
div.button-action li a:empty:only-child { display: none; }
div.button-action li a {
    position: static !important;
    right: auto !important;
    top: auto !important;
    display: inline-flex;
    align-items: center;
    color: #004074;
    font-weight: 600;
    font-size: 12px;
}
div.button-action li.pdf_voir a .fa { color: #c0392b; }      /* PDF rouge */
div.button-action li.pdf_inactif { opacity: .55; }
div.button-action li.pdf_inactif a .fa { color: #8a99ab; }
div.button-action li:hover { background: #f5f8fc !important; }
/* Bulle "ajouter un échange" : bouton bleu, enveloppe centrée */
div.button-action li.ajouter_echange {
    background: #2196f3 !important;
    border-color: #2196f3 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}
div.button-action li.ajouter_echange a {
    color: #ffffff !important;
    display: inline-flex !important;
    align-items: center !important;
    line-height: 1 !important;
}
div.button-action li.ajouter_echange:hover { background: #004074 !important; }

/* --------------------------------------------------------------------------
   Badge d'état du dossier ("En cours de saisie", "Validé"...)
   -------------------------------------------------------------------------- */
#etat_dossier p,
#etat_dossier_numerique p,
#etat_dossier_dsh_pgid p {
    display: inline-block;
    border-radius: 999px !important;
    padding: 4px 12px !important;
    font-weight: 600;
    white-space: nowrap;
}

/* --------------------------------------------------------------------------
   Bandeaux d'information (jaune) — adoucis
   -------------------------------------------------------------------------- */
div#message_information div.message_information,
div.message_information,
div.message_information_annexe {
    background-color: #fff8e6 !important;
    border: 1px solid #efe1b3 !important;
    border-radius: 8px !important;
    color: #6b5d33 !important;
}

/* --------------------------------------------------------------------------
   Barre du haut (#header)
   -------------------------------------------------------------------------- */
#header {
    width: auto;                 /* avant : 1320px centré → désaligné du contenu */
    padding: 0 12px;
    box-sizing: border-box;
}

#select_portail {
    background: rgba(255,255,255,.12);
    color: #ffffff;
    border: 1px solid rgba(255,255,255,.25);
    border-radius: 8px;
    padding: 6px 10px;
    font-weight: 600;
    margin-top: 9px;
    margin-left: 8px;
}
#select_portail option { color: #1f2b3a; }

/* Entrées de menu : coins arrondis au survol et sur l'actif */
div.navigation li { border-radius: 8px; }
div.navigation li:hover { border-radius: 8px; }
div.navigation li.accueil.select,
div.navigation li.agenda-controleur.select,
div.navigation li.dossiers.select,
div.navigation li.dossiers-numerique.select,
div.navigation li.demandes.select,
div.navigation li.administration.select,
div.navigation li.portefeuille.select,
div.navigation li.planification.select {
    border-radius: 8px;
    background-position-x: 1.1em;   /* recentre l'icône dans la pilule arrondie */
}

/* Liens « Assistance / Déconnexion » plus discrets */
#header div.user_sites p.user a.quit,
#header div.user_sites a.sudo { text-decoration: none; }
#header div.user_sites a:hover { text-decoration: underline; }
