/* =====================================================================
   Pointage — feuille de style de l'application
   ---------------------------------------------------------------------
   Aucune dépendance externe. Ce fichier fournit la grille, les
   composants (cartes, tableaux, boutons, formulaires, navigation,
   alertes…) et les utilitaires employés par les vues.

   Sommaire
     1.  Variables
     2.  Base et réinitialisation
     3.  Typographie
     4.  Grille
     5.  Utilitaires d'affichage et d'espacement
     6.  Boutons
     7.  Formulaires
     8.  Tableaux
     9.  Cartes
     10. Navigation et menus
     11. Alertes, badges, listes
     12. Icônes
     13. Calendrier
     14. Impression
     15. Adaptations mobiles
   ===================================================================== */

/* ---------------------------------------------------------------------
   1. Variables
   ------------------------------------------------------------------ */
:root {
    --bleu:            #0d6efd;
    --bleu-fonce:      #0b5ed7;
    --bleu-plus-fonce: #0a58ca;
    --gris:            #6c757d;
    --gris-fonce:      #5c636a;
    --vert:            #198754;
    --vert-fonce:      #157347;
    --rouge:           #dc3545;
    --rouge-fonce:     #bb2d3b;
    --jaune:           #ffc107;
    --jaune-fonce:     #ffca2c;
    --sombre:          #212529;

    --texte:           #212529;
    --texte-attenue:   rgba(33, 37, 41, 0.75);
    --fond:            #fff;
    --fond-attenue:    #e9ecef;
    --fond-leger:      #f8f9fa;
    --bordure:         #dee2e6;
    --bordure-marquee: rgba(0, 0, 0, 0.175);

    --rayon:           0.375rem;
    --rayon-sm:        0.25rem;
    --rayon-lg:        0.5rem;

    --ombre-sm:        0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --focus:           0 0 0 0.25rem rgba(13, 110, 253, 0.25);

    --police: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue",
              "Noto Sans", "Liberation Sans", Arial, sans-serif;
    --police-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
                   "Liberation Mono", monospace;

    /* gouttières de la grille */
    --gx: 1.5rem;
    --gy: 0;
}

/* ---------------------------------------------------------------------
   2. Base et réinitialisation
   ------------------------------------------------------------------ */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

body {
    margin: 0;
    font-family: var(--police);
    font-size: 0.95rem;
    font-weight: 400;
    line-height: 1.5;
    color: var(--texte);
    background-color: var(--fond);
    -webkit-font-smoothing: antialiased;
}

hr {
    margin: 1rem 0;
    border: 0;
    border-top: 1px solid var(--bordure);
    opacity: 0.25;
}

a {
    color: var(--bleu);
    text-decoration: underline;
}

a:hover {
    color: var(--bleu-plus-fonce);
}

img,
svg {
    vertical-align: middle;
}

code {
    font-family: var(--police-mono);
    font-size: 0.875em;
    color: #d63384;
    word-wrap: break-word;
}

dl,
dd {
    margin: 0;
}

dt {
    font-weight: 700;
}

th {
    font-weight: 600;
    text-align: inherit;
    text-align: -webkit-match-parent;
}

ul,
ol {
    margin-top: 0;
    margin-bottom: 1rem;
    padding-left: 2rem;
}

p {
    margin-top: 0;
    margin-bottom: 1rem;
}

label {
    display: inline-block;
}

button,
input,
optgroup,
select,
textarea {
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
    margin: 0;
}

button {
    text-transform: none;
    cursor: pointer;
}

[role="button"],
button:not(:disabled),
[type="button"]:not(:disabled),
[type="submit"]:not(:disabled) {
    cursor: pointer;
}

/* ---------------------------------------------------------------------
   3. Typographie
   ------------------------------------------------------------------ */
h1, h2, h3, h4, h5, h6,
.h4, .h5, .h6 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-weight: 500;
    line-height: 1.2;
}

h1        { font-size: calc(1.375rem + 1.5vw); }
h2        { font-size: calc(1.325rem + 0.9vw); }
h3        { font-size: calc(1.3rem + 0.6vw); }
h4, .h4   { font-size: calc(1.275rem + 0.3vw); }
h5, .h5   { font-size: 1.25rem; }
h6, .h6   { font-size: 1rem; }

.display-1,
.display-5,
.display-6 {
    font-weight: 300;
    line-height: 1.2;
}

.display-1 { font-size: calc(1.625rem + 4.5vw); }
.display-5 { font-size: calc(1.475rem + 2.7vw); }
.display-6 { font-size: calc(1.375rem + 1.5vw); }

/* Tailles fluides sous 1200 px, figées au-delà (voir la requête média) */
.fs-2 { font-size: calc(1.325rem + 0.9vw) !important;}
.fs-4 { font-size: calc(1.275rem + 0.3vw) !important;}
.fs-5 { font-size: 1.25rem !important;}
.fs-6 { font-size: 1rem !important;}

@media (min-width: 1200px) {
    h1        { font-size: 2.5rem; }
    h2        { font-size: 2rem; }
    h3        { font-size: 1.75rem; }
    h4, .h4   { font-size: 1.5rem; }
    .display-1 { font-size: 5rem; }
    .display-5 { font-size: 3rem; }
    .display-6 { font-size: 2.5rem; }
    .fs-2     { font-size: 2rem !important;}
    .fs-4     { font-size: 1.5rem !important;}
}

.small          { font-size: 0.875em !important;}
.fw-normal      { font-weight: 400 !important;}
.fw-semibold    { font-weight: 600 !important;}
.font-monospace { font-family: var(--police-mono) !important;}

.text-center         { text-align: center !important;}
.text-end            { text-align: right !important;}
.text-uppercase      { text-transform: uppercase !important;}
.text-nowrap         { white-space: nowrap !important;}
.text-decoration-none { text-decoration: none !important;}

.text-truncate {
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

.text-body-secondary { color: var(--texte-attenue) !important;}
.text-primary        { color: var(--bleu) !important;}
.text-success        { color: var(--vert) !important;}
.text-danger         { color: var(--rouge) !important;}

/* ---------------------------------------------------------------------
   4. Grille
   ------------------------------------------------------------------ */
.container,
.container-fluid {
    width: 100%;
    margin-right: auto;
    margin-left: auto;
    padding-right: 0.75rem;
    padding-left: 0.75rem;
}

@media (min-width: 576px)  { .container { max-width: 540px; } }
@media (min-width: 768px)  { .container { max-width: 720px; } }
@media (min-width: 992px)  { .container { max-width: 960px; } }
@media (min-width: 1200px) { .container { max-width: 1140px; } }
@media (min-width: 1400px) { .container { max-width: 1320px; } }

.row {
    display: flex;
    flex-wrap: wrap;
    margin-top: calc(-1 * var(--gy));
    margin-right: calc(-0.5 * var(--gx));
    margin-left: calc(-0.5 * var(--gx));
}

.row > * {
    flex-shrink: 0;
    width: 100%;
    max-width: 100%;
    padding-right: calc(var(--gx) * 0.5);
    padding-left: calc(var(--gx) * 0.5);
    margin-top: var(--gy);
}

.g-2 { --gx: 0.5rem;  --gy: 0.5rem; }
.g-3 { --gx: 1rem;    --gy: 1rem; }
.g-4 { --gx: 1.5rem;  --gy: 1.5rem; }

.col-1  { flex: 0 0 auto; width: 8.33333333%; }
.col-5  { flex: 0 0 auto; width: 41.66666667%; }
.col-6  { flex: 0 0 auto; width: 50%; }
.col-7  { flex: 0 0 auto; width: 58.33333333%; }
.col-12 { flex: 0 0 auto; width: 100%; }

@media (min-width: 768px) {
    .col-md-1  { flex: 0 0 auto; width: 8.33333333%; }
    .col-md-2  { flex: 0 0 auto; width: 16.66666667%; }
    .col-md-3  { flex: 0 0 auto; width: 25%; }
    .col-md-4  { flex: 0 0 auto; width: 33.33333333%; }
    .col-md-5  { flex: 0 0 auto; width: 41.66666667%; }
    .col-md-6  { flex: 0 0 auto; width: 50%; }
    .col-md-10 { flex: 0 0 auto; width: 83.33333333%; }
}

@media (min-width: 992px) {
    .col-lg-3  { flex: 0 0 auto; width: 25%; }
    .col-lg-4  { flex: 0 0 auto; width: 33.33333333%; }
    .col-lg-5  { flex: 0 0 auto; width: 41.66666667%; }
    .col-lg-6  { flex: 0 0 auto; width: 50%; }
    .col-lg-7  { flex: 0 0 auto; width: 58.33333333%; }
    .col-lg-8  { flex: 0 0 auto; width: 66.66666667%; }
    .col-lg-9  { flex: 0 0 auto; width: 75%; }
    .col-lg-10 { flex: 0 0 auto; width: 83.33333333%; }
}

/* ---------------------------------------------------------------------
   5. Utilitaires d'affichage et d'espacement
   ------------------------------------------------------------------ */
.d-flex   { display: flex; }
.d-inline { display: inline !important;}
.d-none   { display: none !important;}

.flex-wrap               { flex-wrap: wrap !important;}
.justify-content-between { justify-content: space-between !important;}
.justify-content-center  { justify-content: center !important;}
.align-items-center      { align-items: center !important;}
.align-items-start       { align-items: flex-start !important;}
.align-items-end         { align-items: flex-end !important;}

.gap-2 { gap: 0.5rem !important;}
.gap-3 { gap: 1rem !important;}

.m-0  { margin: 0 !important;}
.mb-0 { margin-bottom: 0 !important;}
.mb-1 { margin-bottom: 0.25rem !important;}
.mb-2 { margin-bottom: 0.5rem !important;}
.mb-3 { margin-bottom: 1rem !important;}
.mb-4 { margin-bottom: 1.5rem !important;}
.mb-5 { margin-bottom: 3rem !important;}
.mt-2 { margin-top: 0.5rem !important;}
.mt-4 { margin-top: 1.5rem !important;}
.mt-5 { margin-top: 3rem !important;}
.ms-2 { margin-left: 0.5rem !important;}
.me-auto { margin-right: auto !important;}
.my-2 { margin-top: 0.5rem; margin-bottom: 0.5rem !important;}

.p-0  { padding: 0 !important;}
.p-1  { padding: 0.25rem !important;}
.p-4  { padding: 1.5rem !important;}
.pt-2 { padding-top: 0.5rem !important;}
.pb-3 { padding-bottom: 1rem !important;}
.py-3 { padding-top: 1rem; padding-bottom: 1rem !important;}
.py-4 { padding-top: 1.5rem; padding-bottom: 1.5rem !important;}
.py-5 { padding-top: 3rem; padding-bottom: 3rem !important;}

@media (min-width: 992px) {
    .mb-lg-0 { margin-bottom: 0 !important;}
    .my-lg-0 { margin-top: 0; margin-bottom: 0 !important;}
    .me-lg-2 { margin-right: 0.5rem !important;}
    .me-lg-3 { margin-right: 1rem !important;}
    .px-lg-4 { padding-right: 1.5rem; padding-left: 1.5rem !important;}
}

.w-100 { width: 100% !important;}
.w-auto { width: auto !important;}
.h-100 { height: 100% !important;}

.border        { border: 1px solid var(--bordure) !important;}
.border-0      { border: 0 !important;}
.border-top    { border-top: 1px solid var(--bordure) !important;}
.border-bottom { border-bottom: 1px solid var(--bordure) !important;}
.rounded       { border-radius: var(--rayon) !important;}
.shadow-sm     { box-shadow: var(--ombre-sm) !important;}

.bg-white          { background-color: #fff !important;}
.bg-dark           { background-color: var(--sombre) !important;}
.bg-body-tertiary  { background-color: var(--fond-leger) !important;}

.sticky-top {
    position: sticky;
    top: 0;
    z-index: 1020;
}

.stretched-link::after {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1;
    content: "";
}

.align-middle { vertical-align: middle !important;}

/* ---------------------------------------------------------------------
   6. Boutons
   ------------------------------------------------------------------ */
.btn {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    color: var(--texte);
    text-align: center;
    text-decoration: none;
    vertical-align: middle;
    white-space: nowrap;
    background-color: transparent;
    border: 1px solid transparent;
    border-radius: var(--rayon);
    transition: color .15s ease-in-out, background-color .15s ease-in-out,
                border-color .15s ease-in-out, box-shadow .15s ease-in-out;
}

.btn:focus-visible {
    outline: 0;
    box-shadow: var(--focus);
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    border-radius: var(--rayon-sm);
}

.btn-primary {
    color: #fff;
    background-color: var(--bleu);
    border-color: var(--bleu);
}

.btn-primary:hover {
    color: #fff;
    background-color: var(--bleu-fonce);
    border-color: var(--bleu-plus-fonce);
}

.btn-link {
    color: var(--bleu);
    text-decoration: underline;
    border-color: transparent;
}

.btn-link:hover {
    color: var(--bleu-plus-fonce);
}

/* Boutons à contour : couleur du texte et de la bordure, remplis au survol */
.btn-outline-primary   { color: var(--bleu);  border-color: var(--bleu); }
.btn-outline-secondary { color: var(--gris);  border-color: var(--gris); }
.btn-outline-success   { color: var(--vert);  border-color: var(--vert); }
.btn-outline-danger    { color: var(--rouge); border-color: var(--rouge); }
.btn-outline-warning   { color: var(--jaune); border-color: var(--jaune); }

.btn-outline-primary:hover   { color: #fff; background-color: var(--bleu);  border-color: var(--bleu); }
.btn-outline-secondary:hover { color: #fff; background-color: var(--gris);  border-color: var(--gris); }
.btn-outline-success:hover   { color: #fff; background-color: var(--vert);  border-color: var(--vert); }
.btn-outline-danger:hover    { color: #fff; background-color: var(--rouge); border-color: var(--rouge); }
.btn-outline-warning:hover   { color: #000; background-color: var(--jaune); border-color: var(--jaune); }

.btn-close {
    box-sizing: content-box;
    width: 1em;
    height: 1em;
    padding: 0.25em;
    color: #000;
    background: transparent url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath stroke='%23000' stroke-width='2' stroke-linecap='round' d='M3 3l10 10M13 3L3 13'/%3e%3c/svg%3e") center/1em auto no-repeat;
    border: 0;
    border-radius: var(--rayon);
    opacity: 0.5;
}

.btn-close:hover { opacity: 0.75; }

/* ---------------------------------------------------------------------
   7. Formulaires
   ------------------------------------------------------------------ */
.form-label {
    margin-bottom: 0.5rem;
}

.form-control,
.form-select {
    display: block;
    width: 100%;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    color: var(--texte);
    background-color: #fff;
    border: 1px solid var(--bordure);
    border-radius: var(--rayon);
    appearance: none;
    transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out;
}

.form-select {
    padding-right: 2.25rem;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px 12px;
}

.form-control:focus,
.form-select:focus {
    border-color: #86b7fe;
    outline: 0;
    box-shadow: var(--focus);
}

.form-control::placeholder {
    color: var(--texte-attenue);
    opacity: 1;
}

.form-control[type="file"] {
    overflow: hidden;
}

textarea.form-control {
    min-height: calc(1.5em + 0.75rem + 2px);
}

.form-control-sm,
.form-select-sm {
    min-height: calc(1.5em + 0.5rem + 2px);
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    border-radius: var(--rayon-sm);
}

.form-select-sm {
    padding-right: 2rem;
    background-position: right 0.5rem center;
}

.form-control.is-invalid,
.form-select.is-invalid {
    border-color: var(--rouge);
}

.form-control.is-invalid:focus,
.form-select.is-invalid:focus {
    box-shadow: 0 0 0 0.25rem rgba(220, 53, 69, 0.25);
}

.form-text {
    margin-top: 0.25rem;
    font-size: 0.875em;
    color: var(--texte-attenue);
}

.form-check {
    display: block;
    min-height: 1.425rem;
    margin-bottom: 0.125rem;
    padding-left: 1.5em;
}

.form-check-input {
    width: 1em;
    height: 1em;
    margin-top: 0.25em;
    vertical-align: top;
    background-color: #fff;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    border: 1px solid rgba(0, 0, 0, 0.25);
    border-radius: 0.25em;
    appearance: none;
    print-color-adjust: exact;
}

/* Décalage à gauche uniquement quand la case est dans un .form-check */
.form-check .form-check-input {
    float: left;
    margin-left: -1.5em;
}

.form-check-input[type="radio"] { border-radius: 50%; }

.form-check-input:checked {
    background-color: var(--bleu);
    border-color: var(--bleu);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='m6 10 3 3 6-6'/%3e%3c/svg%3e");
}

.form-check-input:focus {
    border-color: #86b7fe;
    outline: 0;
    box-shadow: var(--focus);
}

.form-check-label {
    cursor: pointer;
}

/* Interrupteur */
.form-switch {
    padding-left: 2.5em;
}

.form-switch .form-check-input {
    width: 2em;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='rgba(0,0,0,0.25)'/%3e%3c/svg%3e");
    background-position: left center;
    border-radius: 2em;
    transition: background-position .15s ease-in-out;
}

.form-check.form-switch .form-check-input {
    margin-left: -2.5em;
}

.form-switch .form-check-input:checked {
    background-position: right center;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23fff'/%3e%3c/svg%3e");
}

/* Groupe de champs (champ + suffixe) */
.input-group {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    width: 100%;
}

.input-group > .form-control,
.input-group > .form-select {
    position: relative;
    flex: 1 1 auto;
    width: 1%;
    min-width: 0;
}

.input-group-text {
    display: flex;
    align-items: center;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    color: var(--texte);
    text-align: center;
    white-space: nowrap;
    background-color: var(--fond-leger);
    border: 1px solid var(--bordure);
    border-radius: var(--rayon);
}

.input-group > :not(:first-child) {
    margin-left: -1px;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.input-group > :not(:last-child) {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

/* ---------------------------------------------------------------------
   8. Tableaux
   ------------------------------------------------------------------ */
.table {
    width: 100%;
    margin-bottom: 1rem;
    color: var(--texte);
    vertical-align: top;
    border-color: var(--bordure);
    border-collapse: collapse;
}

.table > thead { vertical-align: bottom; }
.table > tbody { vertical-align: inherit; }

/* Densité commune à tous les tableaux, y compris .table-sm */
.table > :not(caption) > * > * {
    padding: 0.55rem 0.6rem;
    border-bottom: 1px solid var(--bordure);
}

.table > tbody > tr:last-child > * { border-bottom: 0; }

.table-light > tr > th,
.table-light > tr > td {
    background-color: var(--fond-leger);
}

.table-hover > tbody > tr:hover > * {
    background-color: rgba(0, 0, 0, 0.055);
}

.table-bordered > :not(caption) > * > * {
    border: 1px solid var(--bordure);
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* En-tête figé dans les tableaux à hauteur limitée */
.table thead.sticky-top th {
    position: sticky;
    top: 0;
    z-index: 2;
    background-color: var(--fond-leger);
}

/* ---------------------------------------------------------------------
   9. Cartes
   ------------------------------------------------------------------ */
.card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    word-wrap: break-word;
    background-color: #fff;
    background-clip: border-box;
    border: 1px solid var(--bordure-marquee);
    border-radius: var(--rayon);
}

.card > .table-responsive:last-child,
.card > .table-responsive:last-child > .table {
    border-bottom-right-radius: var(--rayon);
    border-bottom-left-radius: var(--rayon);
}

.card-body {
    flex: 1 1 auto;
    padding: 1rem;
}

.card-header {
    padding: 0.5rem 1rem;
    margin-bottom: 0;
    background-color: rgba(0, 0, 0, 0.03);
    border-bottom: 1px solid var(--bordure-marquee);
    border-radius: var(--rayon) var(--rayon) 0 0;
}

.card-footer {
    padding: 0.5rem 1rem;
    background-color: rgba(0, 0, 0, 0.03);
    border-top: 1px solid var(--bordure-marquee);
    border-radius: 0 0 var(--rayon) var(--rayon);
}

.card > .table-responsive > .table { margin-bottom: 0; }

/* ---------------------------------------------------------------------
   10. Navigation et menus
   ------------------------------------------------------------------ */
.navbar {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

.navbar > .container-fluid {
    display: flex;
    flex-wrap: inherit;
    align-items: center;
    justify-content: space-between;
}

.navbar-brand {
    padding-top: 0.3125rem;
    padding-bottom: 0.3125rem;
    margin-right: 1rem;
    font-size: 1.25rem;
    text-decoration: none;
    white-space: nowrap;
}

.navbar-nav {
    display: flex;
    flex-direction: column;
    padding-left: 0;
    margin-bottom: 0;
    list-style: none;
}

.nav-link {
    display: block;
    padding: 0.5rem 0;
    text-decoration: none;
    transition: color .15s ease-in-out;
}

.navbar-collapse {
    flex-basis: 100%;
    flex-grow: 1;
    align-items: center;
}

.navbar-toggler {
    padding: 0.25rem 0.75rem;
    font-size: 1.25rem;
    line-height: 1;
    background-color: transparent;
    border: 1px solid transparent;
    border-radius: var(--rayon);
}

.navbar-toggler-icon {
    display: inline-block;
    width: 1.5em;
    height: 1.5em;
    vertical-align: middle;
    background-repeat: no-repeat;
    background-position: center;
    background-size: 100%;
}

/* Variante sombre */
.navbar-dark .navbar-brand   { color: #fff; }
.navbar-dark .nav-link       { color: rgba(255, 255, 255, 0.55); }
.navbar-dark .nav-link:hover { color: rgba(255, 255, 255, 0.75); }
.navbar-dark .nav-link.active { color: #fff; }
.navbar-dark .navbar-toggler { color: rgba(255, 255, 255, 0.55); border-color: rgba(255, 255, 255, 0.1); }
.navbar-dark .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255,255,255,0.55%29' stroke-width='2' stroke-linecap='round' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

@media (min-width: 992px) {
    .navbar-expand-lg                     { flex-wrap: nowrap; justify-content: flex-start; }
    .navbar-expand-lg .navbar-nav         { flex-direction: row; }
    .navbar-expand-lg .navbar-nav .nav-link { padding-right: 0.5rem; padding-left: 0.5rem; }
    .navbar-expand-lg .navbar-collapse    { display: flex !important; flex-basis: auto; }
    .navbar-expand-lg .navbar-toggler     { display: none; }
}

/* Repli (menu mobile) */
.collapse:not(.show) { display: none; }

/* Menu déroulant */
.dropdown { position: relative; }

.dropdown-toggle::after {
    display: inline-block;
    margin-left: 0.255em;
    vertical-align: 0.255em;
    content: "";
    border-top: 0.3em solid;
    border-right: 0.3em solid transparent;
    border-bottom: 0;
    border-left: 0.3em solid transparent;
}

.dropdown-menu {
    position: absolute;
    z-index: 1000;
    display: none;
    min-width: 10rem;
    padding: 0.5rem 0;
    margin: 0;
    font-size: 1rem;
    color: var(--texte);
    text-align: left;
    list-style: none;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: var(--rayon);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.dropdown-menu.show { display: block; }

.dropdown-menu-end { right: 0; left: auto; }

.dropdown-item {
    display: block;
    width: 100%;
    padding: 0.25rem 1rem;
    clear: both;
    font-weight: 400;
    color: var(--texte);
    text-align: inherit;
    text-decoration: none;
    white-space: nowrap;
    background-color: transparent;
    border: 0;
}

.dropdown-item:hover,
.dropdown-item:focus {
    color: #1e2125;
    background-color: var(--fond-attenue);
}

.dropdown-divider {
    height: 0;
    margin: 0.5rem 0;
    overflow: hidden;
    border-top: 1px solid rgba(0, 0, 0, 0.15);
    opacity: 1;
}

/* ---------------------------------------------------------------------
   11. Alertes, badges, listes
   ------------------------------------------------------------------ */
.alert {
    position: relative;
    padding: 1rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    border-radius: var(--rayon);
}

.alert-success   { color: #0f5132; background-color: #d1e7dd; border-color: #badbcc; }
.alert-danger    { color: #842029; background-color: #f8d7da; border-color: #f5c2c7; }
.alert-info      { color: #055160; background-color: #cff4fc; border-color: #b6effb; }
.alert-warning   { color: #664d03; background-color: #fff3cd; border-color: #ffecb5; }
.alert-secondary { color: #41464b; background-color: #e2e3e5; border-color: #d3d6d8; }

.alert-dismissible { padding-right: 3rem; }

.alert-dismissible .btn-close {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 2;
    padding: 1.25rem 1rem;
}

.fade { transition: opacity 0.15s linear; }
.fade:not(.show) { opacity: 0; }

.badge {
    display: inline-block;
    padding: 0.35em 0.65em;
    font-size: 0.75em;
    font-weight: 700;
    line-height: 1;
    color: #fff;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: var(--rayon);
}

.text-bg-primary   { color: #fff; background-color: var(--bleu) !important;}
.text-bg-secondary { color: #fff; background-color: var(--gris) !important;}
.text-bg-success   { color: #fff; background-color: var(--vert) !important;}
.text-bg-danger    { color: #fff; background-color: var(--rouge) !important;}
.text-bg-warning   { color: #000; background-color: var(--jaune) !important;}
.text-bg-dark      { color: #fff; background-color: var(--sombre) !important;}
.text-bg-light     { color: var(--texte); background-color: var(--fond-leger) !important;}

.list-group {
    display: flex;
    flex-direction: column;
    padding-left: 0;
    margin-bottom: 0;
    border-radius: var(--rayon);
}

.list-group-item {
    position: relative;
    display: block;
    padding: 0.5rem 1rem;
    color: var(--texte);
    text-decoration: none;
    background-color: #fff;
    border: 1px solid var(--bordure);
}

.list-group-item + .list-group-item { border-top-width: 0; }

.list-group-item:first-child { border-radius: var(--rayon) var(--rayon) 0 0; }
.list-group-item:last-child  { border-radius: 0 0 var(--rayon) var(--rayon); }

.list-group-flush { border-radius: 0; }

.list-group-flush > .list-group-item {
    border-width: 0 0 1px;
    border-radius: 0;
}

.list-group-flush > .list-group-item:last-child { border-bottom-width: 0; }

.list-group-item-action:hover {
    background-color: var(--fond-leger);
}

/* ---------------------------------------------------------------------
   12. Icônes
   ------------------------------------------------------------------ */
.icone {
    width: 1em;
    height: 1em;
    vertical-align: -0.125em;
    fill: currentColor;
    flex-shrink: 0;
}

/* ---------------------------------------------------------------------
   13. Calendrier
   ------------------------------------------------------------------ */
.calendrier {
    table-layout: fixed;
}

.calendrier td {
    height: 108px;
    vertical-align: top;
    padding: 0.5rem;
    overflow: hidden;
}

.calendrier .numero-jour {
    font-weight: 600;
    color: var(--texte);
}

.calendrier .jour-calendrier:hover {
    background-color: var(--fond-leger);
}

.calendrier .aujourdhui {
    outline: 2px solid var(--bleu);
    outline-offset: -2px;
}

.calendrier .jour-complet {
    background-color: rgba(25, 135, 84, 0.10);
}

.calendrier .jour-partiel {
    background-color: rgba(255, 193, 7, 0.14);
}

.calendrier .ajout-rapide {
    opacity: 0.35;
}

.calendrier td:hover .ajout-rapide {
    opacity: 1;
}

.legende {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 3px;
    vertical-align: -2px;
    margin-right: 0.25rem;
}

.legende.jour-complet { background-color: rgba(25, 135, 84, 0.35); }
.legende.jour-partiel { background-color: rgba(255, 193, 7, 0.45); }

/* ---------------------------------------------------------------------
   13 bis. Tâches
   ------------------------------------------------------------------ */
.tache-faite > td { opacity: 0.6; }

.tache-faite .fw-semibold { text-decoration: line-through; }

.liste-taches {
    list-style: none;
    margin: 0;
    padding: 0;
}

.liste-taches > li {
    padding: 0.4rem 0;
    border-bottom: 1px solid var(--bordure, #dee2e6);
}

.liste-taches > li:last-child { border-bottom: 0; }

/* Bandeau défilant des tâches à traiter, sous la barre de menu */
.bandeau-taches {
    display: flex;
    align-items: stretch;
    background-color: var(--fond-leger);
    border-bottom: 1px solid var(--bordure);
    font-size: 0.875rem;
    overflow: hidden;
}

.bandeau-taches-titre {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex: 0 0 auto;
    padding: 0.4rem 0.75rem;
    background-color: var(--fond-attenue);
    border-right: 1px solid var(--bordure);
    color: var(--texte);
    text-decoration: none;
    white-space: nowrap;
}

.bandeau-taches-titre:hover { background-color: var(--bordure); }

.bandeau-taches-fenetre {
    flex: 1 1 auto;
    overflow: hidden;
}

.bandeau-taches-piste {
    display: flex;
    width: max-content;
    animation: defilement-taches var(--duree-bandeau, 40s) linear infinite;
}

.bandeau-taches:hover .bandeau-taches-piste,
.bandeau-taches:focus-within .bandeau-taches-piste {
    animation-play-state: paused;
}

.bandeau-taches-groupe {
    display: flex;
    flex: 0 0 auto;
}

.bandeau-taches-item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 1.25rem;
    color: var(--texte-attenue);
    text-decoration: none;
    white-space: nowrap;
    border-right: 1px solid var(--bordure);
}

.bandeau-taches-item:hover { color: var(--bleu); background-color: var(--fond); }

.bandeau-taches-item.est-en-retard { color: var(--rouge); font-weight: 600; }

.bandeau-taches-item.est-aujourdhui { color: #997404; font-weight: 600; }

.bandeau-taches-item.est-en-cours > span { font-style: italic; }

@keyframes defilement-taches {
    from { transform: translateX(0); }
    to   { transform: translateX(var(--decalage-bandeau, -50%)); }
}

/* Le défilement est la raison d'être du bandeau : il reste actif même quand le
   système demande des animations réduites (cas de Windows « animations
   désactivées »), mais deux fois plus lent. */
@media (prefers-reduced-motion: reduce) {
    .bandeau-taches-piste { animation-duration: calc(var(--duree-bandeau, 40s) * 2); }
}

/* ---------------------------------------------------------------------
   14. Impression
   ------------------------------------------------------------------ */
@media print {
    .d-print-none { display: none !important; }
    body { background: #fff !important; }
    .card { border: 0 !important; box-shadow: none !important; }
    a { text-decoration: none !important; color: inherit !important; }
}

/* ---------------------------------------------------------------------
   15. Adaptations mobiles
   ------------------------------------------------------------------ */
@media (max-width: 991.98px) {
    .navbar-nav { width: 100%; }
    .navbar-collapse .btn { display: inline-block; width: auto; }
}

@media (max-width: 575.98px) {
    .bandeau-taches-libelle { display: none; }
    .bandeau-taches-item { padding-left: 0.9rem; padding-right: 0.9rem; }
}

@media (max-width: 767.98px) {
    .calendrier td {
        height: 84px;
        padding: 0.35rem;
        font-size: 0.78rem;
    }
    .display-6 { font-size: 1.6rem; }
}
