/*
 * Barre supérieure (templates/header.html.twig, templates/languages.html.twig).
 * Fichier statique chargé après /build/css/app.css : aucune recompilation nécessaire.
 */

.topbar {
    position: sticky;
    top: 0;
    z-index: 1030;
    margin-bottom: 20px;
    padding: 0; /* app.css : header { padding-bottom: 15px } */
    background: #2b2f35;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
    /* Ombre portée : sur .topbar::after (public/css/ws-nav.css), pas ici (ligne de 1 px au-dessus de la barre) */
    color: #fff;
}

.topbar__inner {
    display: flex;
    align-items: center;
    min-height: 64px;
}

/* --- Gauche : bouton menu (petits écrans) et logo --- */
.topbar__left {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.topbar__burger {
    width: 40px;
    height: 40px;
    margin-right: 12px;
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: 6px;
    background: transparent;
    color: #fff;
    font-size: 1.1rem;
    cursor: pointer;
}

.topbar__burger:hover,
.topbar__burger:focus {
    background: rgba(255, 255, 255, .1);
    outline: none;
}

.topbar__brand {
    display: flex;
    align-items: center;
}

.topbar__brand img {
    max-height: 44px;
    max-width: 210px;
}

/* --- Droite : langue et compte --- */
.topbar__right {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    margin-left: auto;
}

.topbar__right > * + * {
    margin-left: 10px;
}

/* Menus déroulants natifs (<details>) */
.topbar__menu {
    position: relative;
}

.topbar__menu > summary {
    display: flex;
    align-items: center;
    height: 42px;
    padding: 0 10px;
    border: 1px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.topbar__menu > summary::-webkit-details-marker {
    display: none;
}

.topbar__menu > summary:hover,
.topbar__menu[open] > summary {
    border-color: rgba(255, 255, 255, .15);
    background: rgba(255, 255, 255, .08);
}

.topbar__menu > summary:focus {
    outline: none;
}

.topbar__menu > summary:focus-visible {
    box-shadow: 0 0 0 2px rgba(0, 123, 255, .6);
}

.topbar__caret {
    margin-left: 8px;
    font-size: .7rem;
    opacity: .7;
    transition: transform .15s ease;
}

.topbar__menu[open] .topbar__caret {
    transform: rotate(180deg);
}

.topbar__dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 1040;
    min-width: 250px;
    padding: 6px 0;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .3);
    color: #363a41;
}

.topbar__dropdown--narrow {
    min-width: 180px;
}

.topbar__dropdown-header {
    display: flex;
    flex-direction: column;
    padding: 10px 16px 12px;
    margin-bottom: 6px;
    border-bottom: 1px solid #e9ecef;
}

.topbar__email {
    color: #6c757d;
    font-size: .85rem;
    word-break: break-all;
}

.topbar__role {
    align-self: flex-start;
    margin-top: 6px;
    font-weight: 500;
}

.topbar__dropdown .topbar__dropdown-item {
    display: flex;
    align-items: center;
    padding: 9px 16px;
    color: #363a41; /* app.css : a { color: #fff } */
    text-decoration: none;
}

.topbar__dropdown .topbar__dropdown-item:hover,
.topbar__dropdown .topbar__dropdown-item:focus {
    background: #f1f3f5;
    color: #363a41;
}

.topbar__dropdown-item i {
    width: 22px;
    margin-right: 6px;
    text-align: center;
}

.topbar__dropdown .topbar__dropdown-item--danger,
.topbar__dropdown .topbar__dropdown-item--danger:hover {
    color: #c82333;
}

.topbar__dropdown .topbar__dropdown-item.is-active {
    font-weight: 600;
}

.topbar__check {
    margin-left: auto;
    color: #28a745;
}

/* Langue */
.topbar__flag {
    width: 20px;
    height: auto;
    border-radius: 2px;
}

.topbar__dropdown-item .topbar__flag {
    margin-right: 10px;
}

.topbar__lang-code {
    margin-left: 8px;
    font-size: .85rem;
    font-weight: 600;
}

/* Compte */
.topbar__avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 2px solid rgba(255, 255, 255, .85);
    border-radius: 50%;
    color: #fff;
    font-size: .8rem;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0, 0, 0, .4);
}

.topbar__username {
    margin-left: 10px;
    font-weight: 500;
}

/* --- Petits écrans --- */
@media (max-width: 575.98px) {
    .topbar__inner {
        justify-content: space-between;
    }

    .topbar__brand img {
        max-width: 150px;
        max-height: 36px;
    }

    .topbar__dropdown {
        position: fixed;
        top: 70px;
        right: 10px;
        left: 10px;
        min-width: 0;
    }
}

/*
 * Menu latéral (templates/menu.html.twig) : public/css/ws-nav.css (refonte de la navigation du 22/11/2026).
 */

/* Tablette et petit PC (576 à 1199 px) : toute l'appli en pleine largeur, marge latérale de 28 px (avant : .container
   de Bootstrap limité à 720 px à 820 px et à 960 px à 1024 px, bandes vides de part et d'autre). Dès 1200 px : 98 %
   (assets/css/app.scss) ; téléphone : 100 % (Bootstrap). Barre supérieure comprise (même .container). */
@media screen and (min-width: 576px) and (max-width: 1199.98px) {
    .container { max-width: none; padding-right: 28px; padding-left: 28px; }
}

/* Grand écran : colonne du menu à largeur fixe, le contenu prend le reste */
@media (min-width: 1200px) {
    .layout-sidebar {
        flex: 0 0 280px;
        max-width: 280px;
    }

    .layout-content {
        flex: 1 1 0;
        min-width: 0;
        max-width: calc(100% - 280px);
    }
}

/* Tableaux plus larges que l'écran : défilement horizontal dans la zone de contenu, pas de toute la page */
.layout-content {
    overflow-x: auto;
}

/*
 * Accueil (templates/home.html.twig).
 */

.home-hero {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 24px;
    padding: 22px 24px;
    border: 1px solid rgba(255, 255, 255, .06);
    border-radius: 12px;
    background: linear-gradient(135deg, #2b2f35 0%, #23395a 100%);
    color: #fff;
}

.home-hero__avatar {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    margin-right: 18px;
    border: 3px solid rgba(255, 255, 255, .85);
    border-radius: 50%;
    font-size: 1.2rem;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0, 0, 0, .4);
}

.home-hero__text {
    flex: 1;
    min-width: 200px;
}

.home-hero__title {
    margin: 0;
    font-size: 1.6rem;
    font-weight: 600;
}

.home-hero__subtitle {
    margin: 4px 0 0;
    color: #b8c0c8;
}

.home-hero__meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    margin-left: 16px;
}

.home-hero__date {
    margin-bottom: 6px;
    color: #b8c0c8;
    font-size: .9rem;
}

.home-heading {
    margin: 0 0 12px;
    color: #6c757d;
    font-size: .8rem;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
}

/* Indicateurs (zone de contenu blanche : .page dans app.css) */
.home-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.page a.home-kpi {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    align-items: center;
    column-gap: 14px;
    padding: 16px 18px;
    border: 1px solid #e3e6ea;
    border-left: 4px solid var(--tone);
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .06);
    color: #363a41;
    transition: transform .12s ease, box-shadow .12s ease;
}

.page a.home-kpi:hover,
.page a.home-kpi:focus {
    box-shadow: 0 6px 16px rgba(0, 0, 0, .1);
    text-decoration: none;
    transform: translateY(-2px);
}

.home-kpi--blue { --tone: #007bff; }
.home-kpi--red { --tone: #dc3545; }
.home-kpi--amber { --tone: #e0a800; }
.home-kpi--green { --tone: #28a745; }
.home-kpi--grey { --tone: #adb5bd; }

.home-kpi__icon {
    display: flex;
    grid-row: 1 / 3;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: #f1f3f5;
    color: var(--tone);
    font-size: 1.15rem;
}

.home-kpi__value {
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1.1;
}

.home-kpi__label {
    color: #6c757d;
    font-size: .85rem;
}

/* Planning du jour */
.home-panel {
    margin-bottom: 24px;
    padding: 16px 18px;
    border: 1px solid #e3e6ea;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .06);
}

.home-panel__header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.home-panel__title {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.home-panel__title i {
    margin-right: 6px;
    color: #e0a800;
}

.page a.home-panel__link {
    color: #007bff;
    font-size: .875rem;
}

.home-panel__empty,
.home-panel__more {
    margin: 0;
    color: #6c757d;
    font-size: .9rem;
}

.home-panel__more {
    margin-top: 8px;
}

.home-planning {
    margin: 0;
    padding: 0;
    list-style: none;
}

.home-planning__row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    padding: 8px 0;
    border-top: 1px solid #eef0f2;
    font-size: .9rem;
}

.home-planning__row > * + * {
    margin-left: 12px;
}

.home-planning__time {
    min-width: 48px;
    color: #b38600;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.home-planning__name {
    flex: 1;
    min-width: 180px;
}

.home-planning__name small {
    margin-left: 6px;
    color: #6c757d;
}

.home-planning__qty,
.home-planning__machine {
    color: #495057;
    white-space: nowrap;
}

/* Accès rapides */
.home-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    align-items: start;
    gap: 14px;
    margin-bottom: 20px;
}

.home-tile {
    padding: 14px 16px;
    border: 1px solid #e3e6ea;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .06);
}

.home-tile__head {
    display: flex;
    align-items: center;
    color: #363a41;
    font-weight: 600;
}

.home-tile__icon {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    margin-right: 10px;
    border-radius: 8px;
    background: #e7f1ff;
    color: #007bff;
    line-height: 34px;
    text-align: center;
}

.home-tile__title {
    flex: 1;
    min-width: 0;
}

.home-tile__go {
    color: #adb5bd;
    font-size: .8rem;
}

.page a.home-tile--link {
    display: flex;
    align-items: center;
    transition: box-shadow .12s ease;
}

.home-tile--link .home-tile__head {
    flex: 1;
}

.page a.home-tile--link:hover,
.page a.home-tile--link:focus {
    box-shadow: 0 6px 16px rgba(0, 0, 0, .1);
    text-decoration: none;
}

.home-tile--link:hover .home-tile__go {
    color: #007bff;
}

.home-tile__links {
    margin: 10px 0 0 44px;
    padding: 0;
    list-style: none;
}

.page .home-tile__links a {
    display: block;
    padding: 3px 0;
    color: #495057;
    font-size: .875rem;
}

.page .home-tile__links a:hover,
.page .home-tile__links a:focus {
    color: #007bff;
}

@media (max-width: 575.98px) {
    .home-hero__meta {
        flex-direction: row;
        align-items: center;
        width: 100%;
        margin: 12px 0 0;
    }

    .home-hero__date {
        margin: 0 10px 0 0;
    }
}

/*
 * Liste des utilisateurs (templates/Users/index.html.twig).
 */

.users-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.users-head__title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.users-head__count {
    margin: 2px 0 0;
    color: #6c757d;
    font-size: .9rem;
}

.page a.users-head__add {
    margin: 8px 0;
    color: #fff;
}

.users-head__add i {
    margin-right: 6px;
}

.users-alert i {
    margin-right: 6px;
}

/* Onglets de statut et filtres */
.users-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.users-tabs {
    display: inline-flex;
    margin: 0 12px 10px 0;
    padding: 4px;
    border-radius: 10px;
    background: #f1f3f5;
}

.page a.users-tabs__tab {
    display: flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 7px;
    color: #495057;
    font-size: .9rem;
    font-weight: 500;
    white-space: nowrap;
}

.page a.users-tabs__tab:hover {
    color: #212529;
    text-decoration: none;
}

.page a.users-tabs__tab.is-active {
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .12);
    color: #007bff;
}

.users-tabs__count {
    margin-left: 6px;
    padding: 0 7px;
    border-radius: 10px;
    background: rgba(0, 0, 0, .07);
    font-size: .75rem;
    line-height: 1.6;
}

.users-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 10px;
}

.users-filters > * {
    margin: 0 0 0 8px;
}

/* app.css : form label / table { margin… } ; les champs gardent leur largeur ici */
.users-filters__search {
    position: relative;
    margin-left: 0;
}

.users-filters__search i {
    position: absolute;
    top: 50%;
    left: 11px;
    color: #adb5bd;
    transform: translateY(-50%);
    pointer-events: none;
}

.users-filters__search .form-control {
    width: 260px;
    padding-left: 32px;
}

.users-filters__role.form-control {
    width: auto;
}

/* Tableau */
.users-table-wrap {
    border: 1px solid #e3e6ea;
    border-radius: 10px;
    overflow-x: auto;
}

.page table.users-table {
    width: 100%;
    margin: 0;
}

.page table.users-table thead th {
    border-top: 0;
    border-bottom: 1px solid #e3e6ea;
    background: #f8f9fa;
    color: #6c757d;
    font-size: .75rem;
    font-weight: 600;
    letter-spacing: .05em;
    text-transform: uppercase;
    white-space: nowrap;
}

/* app.css : table { text-transform: uppercase }, cellules en 0.7rem, en-têtes gris foncé */
.page table.users-table,
.page table.users-table td {
    text-transform: none;
}

.page table.users-table td {
    vertical-align: middle;
    border-top: 1px solid #eef0f2;
    font-size: .9rem;
}

.users-table tbody tr:hover {
    background: #f8fafc;
}

.users-table tr.is-inactive td {
    background: #fafafa;
}

.users-table tr.is-inactive .users-name,
.users-table tr.is-inactive .users-email {
    color: #868e96;
}

.users-table tr.is-inactive .users-avatar {
    filter: grayscale(1);
    opacity: .55;
}

.page a.users-name {
    display: inline-flex;
    align-items: center;
    color: #212529;
}

.page a.users-name:hover .users-name__full {
    color: #007bff;
}

.users-avatar {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    margin-right: 12px;
    border-radius: 50%;
    color: #fff;
    font-size: .8rem;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0, 0, 0, .35);
}

.users-name__full {
    display: block;
    font-weight: 600;
    line-height: 1.2;
}

.users-name__title {
    color: #868e96;
}

.users-name__email {
    display: block;
    color: #6c757d;
    word-break: break-all;
}

.users-me {
    margin-left: 8px;
    border: 1px solid #dee2e6;
}

.page a.users-email {
    color: #495057;
    word-break: break-all;
}

.page a.users-email:hover {
    color: #007bff;
}

.users-ip {
    margin-left: 6px;
    color: #adb5bd;
}

.users-role {
    padding: 5px 9px;
    font-weight: 500;
}

.users-status {
    display: inline-flex;
    align-items: center;
    font-size: .875rem;
    font-weight: 500;
    white-space: nowrap;
}

.users-status::before {
    content: "";
    width: 8px;
    height: 8px;
    margin-right: 7px;
    border-radius: 50%;
    background: currentColor;
}

.users-status--on { color: #28a745; }
.users-status--off { color: #868e96; }

.users-actions {
    text-align: right;
    white-space: nowrap;
}

.page a.users-action,
.users-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    margin-left: 2px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 7px;
    background: transparent;
    color: #6c757d;
    cursor: pointer;
}

.page a.users-action:hover,
.users-action:hover,
.users-action:focus {
    border-color: #dee2e6;
    background: #f1f3f5;
    color: #007bff;
    outline: none;
}

.users-action--danger:hover,
.users-action--danger:focus { color: #dc3545; }
.users-action--success:hover,
.users-action--success:focus { color: #28a745; }

.users-empty {
    padding: 40px 20px;
    border: 1px dashed #ced4da;
    border-radius: 10px;
    color: #6c757d;
    text-align: center;
}

.users-empty i {
    margin-bottom: 10px;
    font-size: 2rem;
    opacity: .5;
}

.users-color-name {
    font-weight: 600;
}

@media (max-width: 767.98px) {
    .users-filters {
        width: 100%;
    }

    .users-filters__search {
        flex: 1 1 100%;
        margin-bottom: 8px;
    }

    .users-filters__search .form-control {
        width: 100%;
    }

    .users-filters__role {
        margin-left: 0;
    }

    .users-tabs {
        max-width: 100%;
        overflow-x: auto;
    }
}

.users-color-picker {
    margin-top: 12px;
}

.users-color-picker .colorpicker {
    margin: 0 auto;
}

.users-color-dialog {
    max-width: 340px;
}

/* Actions qui modifient les données (suppressions…) : petit formulaire POST en ligne (templates/_post_action.html.twig),
   même aspect qu'un lien icône */
.post-action {
    display: inline;
    margin: 0;
}
.post-action__link {
    padding: 0;
    border: 0;
    background: none;
    color: #007bff;
    cursor: pointer;
    line-height: inherit;
    vertical-align: baseline;
}
.post-action__link:hover,
.post-action__link:focus {
    color: #0056b3;
    text-decoration: underline;
}

/* Où est le stock (templates/Stock/_where.html.twig) : une étiquette par zone / emplacement */
.where { display: inline-flex; flex-wrap: wrap; gap: 3px 4px; text-transform: none; font-weight: 400; line-height: 1.3; }
.where__item { display: inline-block; padding: 1px 6px; border-radius: 9px; background: #eef1f4; color: #33404f; font-size: .78rem; white-space: nowrap; }
.where__item b { font-weight: 700; }
.where__item--prod { background: #e3f1e6; color: #1e6b34; }
.where__item--blocked { background: #fbebeb; color: #a12622; }
.where__item--neg { background: #a12622; color: #fff; }
.where__item--transit { background: #fff4d6; color: #7a5600; }
.where__item--none { background: transparent; color: #8a94a1; padding-left: 0; }
.where__warn { display: block; width: 100%; color: #a15c00; font-size: .78rem; font-weight: 600; }
.where__habit { display: block; color: #5f6b78; font-size: .78rem; text-transform: none; }
@media print { .where__item { border: 1px solid #999; background: #fff !important; color: #000 !important; } }



/* Alertes intégrées à la barre supérieure (templates/_topbar_alerts.html.twig) ; la barre n'est pas imprimée */
.topbar__alerts { flex-wrap: wrap; align-items: center; flex: 1 1 auto; justify-content: center; gap: 6px; min-width: 0; height: 46px; margin: 0 16px; overflow: hidden; } /* une pastille qui ne tient pas passe à la ligne, donc masquée : elle reste dans la cloche */
a.topbar__alert { display: inline-flex; flex: none; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-width: 58px; height: 46px; padding: 0 10px; border: 1px solid transparent; border-radius: 10px; font-size: .85rem; line-height: 1; text-decoration: none; }
.topbar__alert-top { display: inline-flex; align-items: center; gap: 6px; }
.topbar__alert-label { font-size: .75rem; font-weight: 600; letter-spacing: .01em; opacity: .9; white-space: nowrap; }
/* Entre 992 et 1199 px (tablette en paysage) : pastilles compactes, sans le mot court */
@media (max-width: 1199px) {
    .topbar__alerts { height: 32px; }
    a.topbar__alert { flex-direction: row; gap: 6px; min-width: 0; height: 32px; padding: 0 11px; border-radius: 16px; }
    .topbar__alert-label { display: none; }
}
a.topbar__alert strong { font-weight: 800; }
a.topbar__alert--danger { border-color: rgba(255, 107, 107, .55); background: rgba(229, 57, 53, .22); color: #ffb3b0; }
a.topbar__alert--warning { border-color: rgba(255, 193, 7, .5); background: rgba(255, 193, 7, .15); color: #ffd866; }
a.topbar__alert--info { border-color: rgba(100, 170, 255, .5); background: rgba(33, 150, 243, .15); color: #a8d1ff; }
a.topbar__alert:hover { filter: brightness(1.2); text-decoration: none; }
.topbar__bell > summary { position: relative; justify-content: center; width: 44px; padding: 0; font-size: 1.15rem; }
.topbar__bell-badge { position: absolute; top: 3px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #f0ad4e; color: #212529; font-size: .7rem; font-weight: 800; line-height: 18px; text-align: center; }
.topbar__bell-badge.is-danger { background: #e53935; color: #fff; }
.topbar__dropdown--alerts { min-width: 320px; }
.topbar__dropdown .topbar__alert-row--danger i { color: #c62828; }
.topbar__dropdown .topbar__alert-row--warning i { color: #b7791f; }
.topbar__dropdown .topbar__alert-row--info i { color: #0b4a8b; }
.topbar__alert-none { color: #2e7d32 !important; }

/*
 * Mode tablette (écran tactile jusqu'à 1400 px, ex. tablette 10,4" 2000 × 1200 vue en 1333 × 800) : menu replié
 * derrière le bouton ☰ comme sur petit écran, le contenu prend toute la largeur. Les PC (souris) ne changent pas.
 */
@media (min-width: 1200px) and (max-width: 1400px) and (pointer: coarse) {
    .layout-sidebar,
    .layout-content { flex: 0 0 100%; max-width: 100%; }
}

/* app.css « .page a { color: #363a41 } » l'emporte sur la couleur Bootstrap des liens présentés en bouton plein : texte
   gris foncé sur fond bleu / vert (« Peser », « Inventaire »…), alors que les <button> de même couleur sont en blanc. */
.page a.btn-primary,
.page a.btn-secondary,
.page a.btn-success,
.page a.btn-danger,
.page a.btn-info,
.page a.btn-dark { color: #fff; }
.page a.btn-warning,
.page a.btn-light { color: #212529; }

/* Accueil métier (revue UX 2026-11) : grandes tuiles du travail du jour, autres accès repliés */
.home-work { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin-bottom: 24px; }
.home-work__tile { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; align-items: center; gap: 4px 14px; min-height: 120px; padding: 18px 20px;
    border-radius: 12px; background: #fff; border: 2px solid #0b6fd1; color: #0b3a6e; text-decoration: none; box-shadow: 0 2px 6px rgba(11, 58, 110, .08); }
.home-work__tile:hover, .home-work__tile:focus { text-decoration: none; background: #f2f7fd; color: #0b3a6e; }
.home-work__icon { grid-row: 1 / span 2; font-size: 2.2rem; color: #0b6fd1; }
.home-work__label { font-size: 1.25rem; font-weight: 700; }
.home-work__count { font-size: 2rem; font-weight: 800; line-height: 1; }
.home-work__count.is-zero { color: #5f6b78; }
.home-work__hint { grid-column: 2; font-size: .85rem; color: #5f6b78; margin-top: -2px; }
.home-more > summary { cursor: pointer; list-style: revert; min-height: 44px; }

/* ---------------------------------------------------------------------------------------------------------------
 * Couleurs des actions (revue UI 2026-11) : contraste AA (≥ 4,5:1) sur fond blanc et texte blanc.
 * Rôles : vert = mouvement de stock / valider, bleu = action neutre, jaune plein = signal (texte foncé), rouge = danger.
 * Bouton désactivé : gris franc (et non vert pâle), pour qu'on ne croie pas qu'il a été touché.
 * ------------------------------------------------------------------------------------------------------------- */
.btn-success { background-color: #1e7e34; border-color: #1e7e34; color: #fff; }
.btn-success:hover, .btn-success:focus { background-color: #19692c; border-color: #19692c; color: #fff; }
.btn-outline-success { color: #1e7e34; border-color: #1e7e34; }
.btn-outline-success:hover { background-color: #1e7e34; border-color: #1e7e34; color: #fff; }
.btn-primary { background-color: #0062cc; border-color: #0062cc; color: #fff; }
.btn-primary:hover, .btn-primary:focus { background-color: #0056b3; border-color: #0056b3; color: #fff; }
.btn-outline-primary { color: #0062cc; border-color: #0062cc; }
.btn-outline-primary:hover { background-color: #0062cc; border-color: #0062cc; color: #fff; }
.btn-warning, .btn-outline-warning { background-color: #ffc107; border-color: #e0a800; color: #212529; }
.btn-warning:hover, .btn-outline-warning:hover { background-color: #e0a800; border-color: #c69500; color: #212529; }
.btn-info { background-color: #117a8b; border-color: #117a8b; color: #fff; }
.btn-outline-info { color: #117a8b; border-color: #117a8b; }
.btn-outline-secondary { color: #495057; border-color: #6c757d; }
.btn:disabled, .btn.disabled { background-color: #d5dae0 !important; border-color: #c8ced5 !important; color: #4a535c !important; opacity: 1; cursor: not-allowed; box-shadow: none; }
/* Raison d'un bouton désactivé : écrite sous le bouton (attribut data-reason) */
.btn-reason { display: block; margin-top: 4px; color: #5f6b78; font-size: .85rem; }
.btn:not(:disabled) + .btn-reason { display: none; }
.where__unit { font-size: .75em; opacity: .8; }
/* Icône collée au titre (revue UI) : espace fixe entre l'icône et le texte des titres */
.layout-content h1 > i.fa:first-child, .layout-content h2 > i.fa:first-child, .sorders-head__title > i.fa:first-child { margin-right: .4em; }
/* Tuile-action (formulaire : « Nouvelle palette ») : même apparence qu'une tuile-lien */
.home-work__form { margin: 0; display: contents; }
.home-work__tile--action { width: 100%; border: 2px solid #1e7e34; text-align: left; font: inherit; cursor: pointer; background: #e9f7ee; }

/* ---------------------------------------------------------------------------------------------------------------
 * Fiches de production : liste (templates/RawMaterials/cards.html.twig, « pcards ») et fiche
 * (templates/RawMaterials/addCard.html.twig, « pcard »). Scripts : public/js/production-cards.js, production-card.js.
 * app.css met tableaux et libellés en majuscules (0,7 rem) et app.js (setChosen) ajoute des classes col-sm-* autour
 * des listes Select2 : neutralisés ici, dans ces deux écrans seulement.
 * ------------------------------------------------------------------------------------------------------------- */
/* Pleine largeur comme les autres pages (avant : limité à 1280 px, bande blanche à droite sur grand écran) */
.pcards, .pcard { color: var(--ui-ink, #212529); }
.pcards .btn, .pcard .btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; white-space: nowrap; }
.pcards .form-control, .pcard .form-control { min-height: 40px; }
.pcards form label, .pcard form label { margin: 0 0 4px; text-transform: none; }
.pcards form input, .pcard form input { margin-bottom: 0; }

/* En-tête de liste */
.pcards-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 0 14px; }
.pcards-head__title { margin: 0; }
.pcards-head__count { margin: 2px 0 0; color: var(--ui-muted, #5f6b78); font-size: .95rem; }
.pcards-head__actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* Import depuis un échantillon */
.pcards-import { margin: 0 0 14px; padding: 14px 16px; border: 1px solid #cfe0f5; border-radius: 10px; background: #f4f8fd; }
.pcards-import[hidden] { display: none; }
.pcards-import__label { display: block; font-weight: 600; }
.pcards-import__row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pcards .pcards-import__field, .pcards .pcards-import__select { flex: 1 1 320px; width: 100%; max-width: none; min-width: 0; padding: 0; }
.pcards-import__help { margin: 8px 0 0; color: var(--ui-muted, #5f6b78); font-size: .875rem; }

/* Filtres */
.pcards-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.pcards-filters__search { position: relative; flex: 2 1 260px; }
.pcards-filters__search > i { position: absolute; top: 50%; left: 12px; color: #8a94a1; transform: translateY(-50%); pointer-events: none; }
.pcards-filters__search .form-control { padding-left: 34px; }
.pcards .pcards-filters__client { flex: 1 1 180px; width: auto; }
.pcards .pcards-filters__range, .pcards .pcards-filters__range-inner { flex: 1 1 200px; max-width: none; min-width: 0; padding: 0; }
.pcards .pcards-filters__range-inner { width: 100%; }
.page a.pcards-filters__reset { color: var(--ui-blue, #0062cc); }
/* Select2 à la hauteur des autres champs */
.pcards .select2-container .select2-selection--single,
.pcard .select2-container .select2-selection--single { height: 40px; border-color: #ced4da; border-radius: .25rem; }
.pcards .select2-container .select2-selection--single .select2-selection__rendered,
.pcard .select2-container .select2-selection--single .select2-selection__rendered { line-height: 38px; padding-left: 12px; color: #495057; }
.pcards .select2-container .select2-selection--single .select2-selection__arrow,
.pcard .select2-container .select2-selection--single .select2-selection__arrow { height: 38px; }

/* Onglets de statut et pagination */
.pcards-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.pcards-tabs { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 4px; border-radius: var(--ui-radius, 10px); background: var(--ui-soft, #eef1f4); }
.page a.pcards-tabs__tab { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; border-radius: 8px; color: var(--ui-ink, #212529); font-weight: 600; font-size: .95rem; text-decoration: none; }
.page a.pcards-tabs__tab:hover { background: rgba(255, 255, 255, .6); text-decoration: none; }
.page a.pcards-tabs__tab.is-active { background: #fff; color: var(--ui-navy, #0b3a6e); box-shadow: 0 1px 3px rgba(0, 0, 0, .14); }
.pcards-tabs__count { padding: 1px 8px; border-radius: 10px; background: rgba(0, 0, 0, .07); color: var(--ui-muted, #5f6b78); font-size: .82rem; }
.pcards-toolbar .list-pager { margin: 0; }

/* Tableau */
.pcards-table-wrap { border: 1px solid #e3e6ea; border-radius: 10px; }
.page table.pcards-table { width: 100%; margin: 0; text-transform: none; }
.page table.pcards-table thead th { padding: 0; vertical-align: middle; border-top: 0; border-bottom: 1px solid #dfe3e8; background: #f6f7f9; color: #3d4752; font-size: .8rem; font-weight: 700; white-space: nowrap; }
.page table.pcards-table thead th:first-child { border-top-left-radius: 10px; }
.page table.pcards-table thead th:last-child { border-top-right-radius: 10px; }
.page table.pcards-table thead th > span { display: block; padding: 10px 12px; }
.page a.pcards-sort { display: flex; align-items: center; gap: 6px; min-height: 42px; padding: 0 12px; color: inherit; text-decoration: none; }
.page th.text-right a.pcards-sort { justify-content: flex-end; }
.page a.pcards-sort:hover, .page a.pcards-sort:focus { color: var(--ui-blue, #0062cc); background: #eef3fa; text-decoration: none; }
.page a.pcards-sort.is-active { color: var(--ui-navy, #0b3a6e); }
.pcards-sort i { color: #a3acb6; font-size: .85em; }
.pcards-sort.is-active i { color: var(--ui-blue, #0062cc); }
.page table.pcards-table td { padding: 8px 12px; border-top: 1px solid #eef0f2; vertical-align: middle; font-size: .925rem; color: #333c46; }
.pcards-table tbody tr:hover td { background: #f8fafc; }
.pcards-row.is-archived td { background: #fafafa; color: #6c757d; }
.page .pcards-row.is-archived a.pcards-name__link { color: #5f6b78; }
.page a.pcards-name__link { color: var(--ui-ink, #212529); font-weight: 700; }
.page a.pcards-name__link:hover { color: var(--ui-blue, #0062cc); }
.pcards-version { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px; background: #e7eef8; color: var(--ui-navy, #0b3a6e); font-size: .78rem; font-weight: 700; vertical-align: 1px; }
.pcards-name__ref { color: var(--ui-muted, #5f6b78); font-size: .82rem; font-family: SFMono-Regular, Menlo, Consolas, monospace; }
.pcards-ref, .pcards-num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.page table.pcards-table td.pcards-ref { font-family: SFMono-Regular, Menlo, Consolas, monospace; font-size: .85rem; }
.pcards-none { color: #adb5bd; }
.pcards-status { display: inline-flex; align-items: center; gap: 6px; font-size: .85rem; font-weight: 600; white-space: nowrap; }
.pcards-status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.pcards-status--on { color: #1e7e34; }
.pcards-status--off { color: #a15c00; }

/* Actions : modifier + menu « ⋯ » */
.pcards-actions { width: 1%; white-space: nowrap; text-align: right; }
/* touch.css agrandit les liens des cellules (inline-block, 10 px de marge) : sans objet pour ces boutons carrés */
.layout-content td > a.pcards-btn { display: inline-flex; padding: 0; }
.page .pcards-btn, .pcards-btn { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border: 1px solid #dfe3e8; border-radius: 8px; background: #fff; color: #3d4752; cursor: pointer; list-style: none; vertical-align: middle; }
.pcards-btn::-webkit-details-marker { display: none; }
.page .pcards-btn:hover, .pcards-btn:focus-visible, .pcards-menu[open] > .pcards-btn { border-color: #b9c3ce; background: #f1f4f7; color: var(--ui-blue, #0062cc); text-decoration: none; outline: none; }
.pcards-btn:focus-visible { box-shadow: 0 0 0 3px rgba(0, 98, 204, .25); }
.pcards-menu { position: relative; display: inline-block; margin-left: 4px; }
.pcards-menu__list { position: absolute; top: calc(100% + 4px); right: 0; z-index: 30; min-width: 240px; padding: 6px; border: 1px solid #dfe3e8; border-radius: 10px; background: #fff; box-shadow: 0 10px 30px rgba(16, 24, 40, .16); text-align: left; }
.pcards-menu.is-up .pcards-menu__list { top: auto; bottom: calc(100% + 4px); }
.pcards-menu__list .post-action { display: block; }
.page .pcards-menu__item, .pcards-menu__item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 40px; padding: 0 12px; border: 0; border-radius: 6px; background: none; color: var(--ui-ink, #212529); font-size: .925rem; line-height: 1.3; text-align: left; text-decoration: none; cursor: pointer; }
.pcards-menu__item i { width: 16px; color: #6c757d; text-align: center; }
.page .pcards-menu__item:hover, .pcards-menu__item:hover, .pcards-menu__item:focus { background: #f1f4f7; color: var(--ui-ink, #212529); text-decoration: none; outline: none; }
.pcards-menu__item.pcards-menu__item--danger, .pcards-menu__item--danger i { color: #b02a37; }
.pcards-menu__item.pcards-menu__item--danger:hover, .pcards-menu__item.pcards-menu__item--danger:focus { background: #fbebeb; color: #b02a37; }
.pcards-menu__sep { margin: 6px 4px; border-top: 1px solid #eef0f2; }

.pcards-empty { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 40px 16px; border: 1px dashed var(--ui-line, #dee2e6); border-radius: 10px; background: #fafbfc; color: var(--ui-muted, #5f6b78); text-align: center; }
.pcards-empty i { font-size: 2rem; color: #adb5bd; }
.pcards-empty p { margin: 0; }

/* Tablette (< 992 px) : référence et statut passent sous le nom */
.pcards-sm { display: none; }
@media (max-width: 991.98px) {
    .pcards-col-lg { display: none; }
    .pcards-filters__search { flex-basis: 100%; }
    .pcards-name .pcards-name__ref.pcards-sm { display: block; }
    .pcards-name .pcards-status.pcards-sm { display: inline-flex; margin-left: 6px; font-size: .78rem; }
    .page table.pcards-table td { padding: 8px 10px; }
}
@media (max-width: 575.98px) {
    .pcards-table-wrap { overflow-x: auto; }
    .pcards-head__actions { width: 100%; }
}

/* ---------- Fiche ---------- */
.pcard-head { margin: 4px 0 16px; padding-bottom: 14px; border-bottom: 1px solid #e3e6ea; }
.pcard-head__title { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin: 0 0 6px; }
.pcard-head__title .pcards-version { margin-left: 0; font-size: .85rem; }
.pcard-head__title .pcards-status { font-size: .9rem; }
.pcard-head__path { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 0 0 4px; font-size: 1rem; font-weight: 600; color: #3d4752; }
.pcard-head__path > i { color: #8a94a1; }
.pcard-head__sep { color: #8a94a1; }
.pcard-head__ref { margin-left: 8px; padding: 1px 8px; border-radius: 6px; background: #f1f3f5; font-family: SFMono-Regular, Menlo, Consolas, monospace; font-size: .85rem; font-weight: 500; }
.pcard-head__meta { margin: 0; color: var(--ui-muted, #5f6b78); font-size: .9rem; }

.pcard-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.pcard-grid--after { align-items: start; margin-top: 24px; }
.pcard-section { min-width: 0; padding: 16px 18px 18px; border: 1px solid #e3e6ea; border-radius: 12px; background: #fff; }
.pcard-section--wide { grid-column: 1 / -1; }
.pcard-section__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-bottom: 8px; }
.pcard-section__title { margin: 0 0 12px; font-size: 1.1rem; font-weight: 700; color: var(--ui-ink, #212529); }
.pcard-section__head .pcard-section__title { margin: 0; }
.layout-content .pcard-section__title > i.fa:first-child { width: 1.2em; margin-right: 6px; color: #5a7fb5; text-align: center; }
.pcard-section__intro { margin: 0 0 8px; color: var(--ui-muted, #5f6b78); }
.pcard .form-group { margin-bottom: 14px; }
.pcard form label, .pcard-label { display: block; margin: 0 0 4px; color: #3d4752; font-size: .875rem; font-weight: 600; text-transform: none; }
.pcard-req { color: #b02a37; }
.pcard-static { min-height: 40px; padding: 8px 12px; border-radius: .25rem; background: #f6f7f9; color: #3d4752; }
.pcard-muted { color: var(--ui-muted, #5f6b78); }
.pcard-ref { font-family: SFMono-Regular, Menlo, Consolas, monospace; }
.pcard .input-group-text { min-width: 44px; justify-content: center; background: #f1f3f5; color: #5f6b78; }
.pcard .form-text { margin-top: 4px; font-size: .8rem; }
.pcard .custom-file, .pcard .custom-file-input, .pcard .custom-file-label { height: 40px; }
.pcard form .custom-file-label { margin: 0; overflow: hidden; color: #495057; font-weight: 400; line-height: 1.75; text-overflow: ellipsis; white-space: nowrap; }
.pcard .custom-file-label::after { height: 38px; line-height: 1.75; content: attr(data-browse); }
.pcard-stamp { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 8px; }
.pcard form .pcard-stamp .custom-control-label { margin: 0; font-weight: 400; }
.pcard-ean img { max-width: 100%; height: auto; max-height: 90px; }
.pcard-help { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0 0 10px; padding: 8px 12px; border-radius: 8px; background: #f4f8fd; color: #33404f; font-size: .875rem; }
.pcard-help[hidden] { display: none; }
.pcard-help > i { color: #5a7fb5; }
.pcard-help--warn { background: #fff4d6; color: #6b4d00; }
.pcard-help--warn > i { color: #a15c00; }
.pcard .barcode-locked { background-color: #e9ecef !important; cursor: not-allowed; } /* bidon d'un client interne (BarcodePolicy) */

/* Total des % (#errorpct : classes alert-success / alert-danger posées par app.js) */
.pcard-total { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.pcard-total__label { color: #3d4752; font-weight: 600; }
.pcard-total__value.alert { margin: 0; padding: 4px 12px; border-radius: 999px; font-weight: 700; font-variant-numeric: tabular-nums; }
.pcard-total__value:empty { display: none; }
.pcard-total__hint { color: #b02a37; font-size: .9rem; font-weight: 600; }
.pcard-total__value.is-shaking { animation: pcard-shake .4s; }
@keyframes pcard-shake { 0%, 100% { transform: none; } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

/* Lignes de composition / consommables : grille Matière | quantité | coût | retirer.
   Le <div id="cardProducts_N"> du prototype est « transparent » (display: contents) pour que ses deux colonnes
   rejoignent la grille ; app.js y pose col-sm-* (largeurs Bootstrap) : neutralisées. */
.pcard-lines__head, .pcard .pcard-line { display: grid; grid-template-columns: minmax(0, 1fr) 140px 110px 44px; gap: 10px; align-items: center; }
.pcard-lines__head { padding: 6px 0; border-bottom: 1px solid #dfe3e8; color: #5f6b78; font-size: .8rem; font-weight: 700; }
.pcard .pcard-lines { margin: 0; padding: 0; }
.pcard .pcard-line { margin: 0; padding: 6px 0; border-bottom: 1px solid #eef0f2; }
.pcard .pcard-line > div[id] { display: contents; }
.pcard .pcard-line [class*="col-sm-"] { flex: none; width: auto; max-width: none; min-width: 0; padding: 0; margin: 0; }
.pcard .pcard-line > div[id] > div:first-child { grid-column: 1; }
.pcard .pcard-line > div[id] > div:nth-child(2) { grid-column: 2; position: relative; }
.pcard .pcard-line input.quantity { width: 100%; text-align: right; font-variant-numeric: tabular-nums; }
.pcard .pcard-lines--pct .pcard-line input.quantity { padding-right: 30px; }
.pcard .pcard-lines--pct .pcard-line > div[id] > div:nth-child(2)::after { content: "%"; position: absolute; top: 50%; right: 12px; color: #6c757d; transform: translateY(-50%); pointer-events: none; }
.pcard-line__cost { grid-column: 3; color: #3d4752; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pcard-line__del { grid-column: 4; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border: 1px solid transparent; border-radius: 8px; background: none; color: #6c757d; cursor: pointer; }
.pcard-line__del:hover, .pcard-line__del:focus-visible { border-color: #f1c6ca; background: #fbebeb; color: #b02a37; outline: none; }
.pcard .pcard-lines__add { padding: 10px 0 0; }
.pcard .pcard-lines__add hr { display: none; }
.pcard .pcard-add { margin: 0; }
.pcard-lines__foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; margin: 12px 0 0; padding-top: 10px; border-top: 1px solid #eef0f2; color: #3d4752; }
.pcard-lines__foot strong { font-variant-numeric: tabular-nums; }

/* Barre d'enregistrement toujours visible (bas d'écran). La zone de contenu défile en largeur (overflow-x: auto) :
   avec elle, « sticky » ne colle jamais ; rendue visible sur cette page (classe posée par production-card.js) */
.layout-content.has-pcard-actions, .layout-content.has-pcards-menu { overflow: visible; } /* idem pour les menus « ⋯ » de la liste */
.pcard-actions { position: sticky; bottom: 0; z-index: 20; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin: 16px -20px 0; padding: 12px 20px; border-top: 1px solid #dfe3e8; background: rgba(255, 255, 255, .97); box-shadow: 0 -6px 18px rgba(16, 24, 40, .08); }
.pcard-actions__summary { display: flex; flex-wrap: wrap; gap: 4px 20px; color: #3d4752; font-size: .95rem; }
.pcard-actions__summary strong { font-variant-numeric: tabular-nums; }
.pcard-actions__pct.is-ok { color: #1e7e34; }
.pcard-actions__pct.is-bad { color: #b02a37; }
.pcard-actions__buttons { display: flex; gap: 8px; margin-left: auto; }
.pcard-actions__buttons .btn { min-height: 44px; min-width: 120px; font-weight: 600; }

/* Disponibilités et historique */
.pcard-dispo { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.pcard-dispo__main { flex: 1 1 160px; padding: 10px 14px; border-radius: 10px; background: #eef5fc; }
.pcard-dispo__value { display: block; color: var(--ui-navy, #0b3a6e); font-size: 1.35rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.pcard-dispo__label { color: #3d4752; font-size: .85rem; }
.page table.pcard-table { margin-bottom: 8px; text-transform: none; }
.page table.pcard-table thead th { border-top: 0; border-bottom: 1px solid #dfe3e8; background: #f6f7f9; color: #3d4752; font-size: .8rem; font-weight: 700; }
.page table.pcard-table td { font-size: .875rem; vertical-align: middle; }
.pcard-table tr.is-limiting td { background: #fff4d6; }
.pcard-table tr.is-excluded td, .pcard-table tr.is-consumable td { color: #5f6b78; }
.pcard-table tr.is-short td { background: #fdf1f1; }
.pcard-flag { display: inline-block; margin-left: 6px; padding: 0 7px; border-radius: 999px; background: #8a4f00; color: #fff; font-size: .72rem; font-weight: 700; }
.pcard-flag--warn { background: #b02a37; }
.pcard-history { max-height: 420px; margin: 0; padding: 0; overflow-y: auto; list-style: none; }
.pcard-history__item { padding: 8px 0 8px 14px; border-left: 2px solid #dfe3e8; font-size: .9rem; }
.pcard-history__item + .pcard-history__item { margin-top: 2px; }
.pcard-history__meta { color: var(--ui-muted, #5f6b78); font-size: .82rem; font-weight: 600; }

@media (max-width: 991.98px) {
    .pcard-grid { grid-template-columns: minmax(0, 1fr); }
    .pcard-lines__head, .pcard .pcard-line { grid-template-columns: minmax(0, 1fr) 130px 90px 44px; gap: 8px; }
}
@media (max-width: 575.98px) {
    .pcard-lines__head { display: none; }
    .pcard .pcard-line { grid-template-columns: minmax(0, 1fr) 44px; }
    .pcard .pcard-line > div[id] > div:first-child { grid-column: 1 / -1; }
    .pcard .pcard-line > div[id] > div:nth-child(2), .pcard-line__cost { grid-column: 1; }
    .pcard-line__del { grid-column: 2; grid-row: 2; }
    .pcard-actions__buttons { width: 100%; }
    .pcard-actions__buttons .btn { flex: 1 1 0; min-width: 0; }
}
@media (pointer: coarse) {
    .pcards .btn, .pcard .btn, .pcards .form-control, .pcard .form-control, .pcards-menu__item { min-height: 44px; }
    .pcards-btn, .page .pcards-btn, .pcard-line__del { width: 44px; height: 44px; }
    .pcards .select2-container .select2-selection--single, .pcard .select2-container .select2-selection--single { height: 44px; }
    .pcards .select2-container .select2-selection--single .select2-selection__rendered,
    .pcard .select2-container .select2-selection--single .select2-selection__rendered { line-height: 42px; }
    .pcards .select2-container .select2-selection--single .select2-selection__arrow,
    .pcard .select2-container .select2-selection--single .select2-selection__arrow { height: 42px; }
}

/* ---------------------------------------------------------------------------------------------------------------
 * Productions en cours / archivées (templates/Production/index.html.twig, « prods ») : même langage que la liste des
 * fiches (« pcards »), préfixe propre pour ne pas toucher à son rendu. Script : public/js/productions.js.
 * Pleine largeur (aucune max-width). Avant : 14 colonnes coupées à 1440 px, icônes de 11 px, ligne urgente en rouge
 * plein (texte à 2,6:1), libellés en majuscules d'app.css.
 * ------------------------------------------------------------------------------------------------------------- */
.prods { color: var(--ui-ink, #212529); }
.prods .btn, .prods-modal .btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; white-space: nowrap; }
.prods .form-control { min-height: 40px; }
.prods form label, .prods-modal form label { margin: 0 0 4px; text-transform: none; }
.prods form input, .prods-modal form input { margin-bottom: 0; }

/* En-tête */
.prods-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 0 14px; }
.prods-head__title { margin: 0; }
.prods-head__count { margin: 2px 0 0; color: var(--ui-muted, #5f6b78); font-size: .95rem; }
.prods-head__urgent, .prods-head__late { color: #b02a37; font-weight: 600; }
.prods-head__actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* Filtres : une ligne sur PC (textes à 0,9 rem pour tenir à 1440 px) */
.prods-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.prods-filters .form-control, .prods-filters .btn { font-size: .9rem; }
.prods-filters__search { position: relative; flex: 1 1 140px; min-width: 140px; }
.prods-filters__search > i { position: absolute; top: 50%; left: 11px; color: #6c757d; transform: translateY(-50%); pointer-events: none; }
.prods-filters__search .form-control { padding-left: 32px; }
.prods .prods-filters__client { flex: 0 1 150px; width: auto; min-width: 140px; }
.prods-filters__period { display: flex; flex: 0 1 208px; gap: 6px; min-width: 0; }
.prods .prods-filters__period .form-control { flex: 1 1 101px; width: 101px; min-width: 100px; padding-left: 10px; padding-right: 8px; }
.prods .prods-filters__flag { flex: 0 0 auto; width: auto; }
.page a.prods-filters__reset { padding-left: 6px; padding-right: 6px; color: var(--ui-blue, #0062cc); }

/* Onglets d'étape et pagination */
.prods-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.prods-tabs { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 4px; border-radius: var(--ui-radius, 10px); background: var(--ui-soft, #eef1f4); }
.page a.prods-tabs__tab { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; border-radius: 8px; color: var(--ui-ink, #212529); font-weight: 600; font-size: .95rem; text-decoration: none; }
.page a.prods-tabs__tab:hover { background: rgba(255, 255, 255, .6); text-decoration: none; }
.page a.prods-tabs__tab.is-active { background: #fff; color: var(--ui-navy, #0b3a6e); box-shadow: 0 1px 3px rgba(0, 0, 0, .14); }
.prods-tabs__count { padding: 1px 8px; border-radius: 10px; background: rgba(0, 0, 0, .07); color: #4a535c; font-size: .82rem; }
.prods-toolbar .list-pager { margin: 0; }

/* Validation groupée (rattrapage sans pesée) */
.prods-bulk { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px 16px; margin: 0 0 10px; padding: 8px 12px; border: 1px solid #f1e3b5; border-radius: 10px; background: #fffaeb; }
.prods-bulk__help { flex: 1 1 300px; margin: 0; color: #5c4a14; font-size: .85rem; }
.prods-bulk__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.prods form .prods-bulk__check { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; margin: 0; color: #3d4752; font-weight: 600; cursor: pointer; }
.prods-bulk__check input { width: 18px; height: 18px; margin: 0; }

/* Tableau */
.prods-table-wrap { border: 1px solid #e3e6ea; border-radius: 10px; }
.page table.prods-table { width: 100%; margin: 0; text-transform: none; }
.page table.prods-table thead th { padding: 0; vertical-align: middle; border-top: 0; border-bottom: 1px solid #dfe3e8; background: #f6f7f9; color: #3d4752; font-size: .8rem; font-weight: 700; white-space: nowrap; }
.page table.prods-table thead th:first-child { border-top-left-radius: 10px; }
.page table.prods-table thead th:last-child { border-top-right-radius: 10px; }
.page table.prods-table thead th > span { display: block; padding: 10px 8px; }
.page table.prods-table thead th.prods-th--center { text-align: center; }
.page a.prods-sort { display: flex; align-items: center; gap: 5px; min-height: 42px; padding: 0 8px; color: inherit; text-decoration: none; }
.page th.text-right a.prods-sort { justify-content: flex-end; }
.page th.prods-th--center a.prods-sort { justify-content: center; }
.page a.prods-sort:hover, .page a.prods-sort:focus { color: var(--ui-blue, #0062cc); background: #eef3fa; text-decoration: none; }
.page a.prods-sort.is-active { color: var(--ui-navy, #0b3a6e); }
.prods-sort i { color: #8a94a1; font-size: .85em; }
.prods-sort.is-active i { color: var(--ui-blue, #0062cc); }
.page table.prods-table td { padding: 8px; border-top: 1px solid #eef0f2; vertical-align: middle; font-size: .875rem; color: #333c46; }
.prods-table tbody tr:hover > td { background: #f8fafc; }
.prods-nowrap { white-space: nowrap; }
.prods-block { display: block; }
.prods-muted { color: var(--ui-muted, #5f6b78); font-size: .8rem; }
.prods-none { color: #8a94a1; }

/* N° d'OF, fiche, quantité */
.prods-of__num { font-family: SFMono-Regular, Menlo, Consolas, monospace; font-weight: 700; white-space: nowrap; }
.prods-of .prods-badge--urgent { margin-left: 2px; }
.page a.prods-card__link { color: var(--ui-ink, #212529); font-weight: 700; }
.page a.prods-card__link:hover { color: var(--ui-blue, #0062cc); }
.prods-dot { display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; vertical-align: 1px; }
.prods-version { display: inline-block; margin-left: 4px; padding: 0 7px; border-radius: 999px; background: #e7eef8; color: var(--ui-navy, #0b3a6e); font-size: .75rem; font-weight: 700; vertical-align: 1px; white-space: nowrap; }
.prods-card__ref { display: block; color: var(--ui-muted, #5f6b78); font-family: SFMono-Regular, Menlo, Consolas, monospace; font-size: .78rem; }
/* Commentaire sur une ligne, tronqué (largeur nulle : n'élargit pas la colonne) */
.prods-comment { display: block; width: 0; min-width: 100%; margin-top: 4px; padding: 1px 8px; overflow: hidden; border-radius: 6px; background: #fff4d6; color: #6b4d00; font-size: .8rem; font-style: italic; white-space: nowrap; text-overflow: ellipsis; }
.prods-comment i { font-style: normal; }
.prods-card { min-width: 170px; }
.prods-qty { white-space: nowrap; font-variant-numeric: tabular-nums; }
.prods-qty__main { font-weight: 600; white-space: nowrap; }

/* Champs de ligne (livraison, n° de commande) : bordure discrète jusqu'au survol ou au focus */
.prods .prods-field { height: 40px; padding: 4px 8px; border-color: #e3e6ea; background: transparent; font-size: .875rem; font-variant-numeric: tabular-nums; }
.prods .prods-field:hover { border-color: #b9c3ce; background: #fff; }
.prods .prods-field:focus { background: #fff; }
.prods .prods-field--date { width: 118px; }
.prods .prods-field--po { width: 150px; }
.prods .prods-field.is-saved { border-color: #1e7e34; box-shadow: 0 0 0 2px rgba(30, 126, 52, .2); }

/* Pastilles : urgent (plein), retard / aujourd'hui (contour), étape (point coloré), manque de stock */
.prods-badge { display: inline-flex; align-items: center; margin-top: 3px; padding: 0 8px; border: 1px solid transparent; border-radius: 999px; font-size: .75rem; font-weight: 700; line-height: 1.5; white-space: nowrap; }
.prods-badge[hidden] { display: none; }
.prods-badge--urgent { border-color: #b02a37; background: #b02a37; color: #fff; }
.prods-badge--late { border-color: #b02a37; background: #fff; color: #b02a37; }
.prods-badge--today { border-color: #a15c00; background: #fff; color: #8a4f00; }
.prods-due { display: flex; flex-wrap: wrap; gap: 4px; }
.prods-step { display: inline-flex; align-items: center; gap: 6px; font-size: .85rem; font-weight: 600; white-space: nowrap; }
.prods-step::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.prods-step--started { white-space: normal; }
.prods-step--started::before { display: none; }
.prods-step--mix { color: #0b5ed7; }
.prods-step--condition { color: #8a4f00; }
.prods-shortage { display: flex; align-items: center; gap: 5px; margin-top: 3px; color: #b02a37; font-size: .8rem; font-weight: 600; white-space: nowrap; }

/* Ligne urgente : fond clair, filet rouge à gauche, badge « Urgent » (jamais la couleur seule) ; ligne cochée */
.prods-table tr.is-urgent > td { background: #fdf1f1; }
.prods-table tbody tr.is-urgent:hover > td { background: #fbe9e9; }
.prods-table tr.is-urgent > td:first-child { box-shadow: inset 4px 0 0 #b02a37; }
.prods-table tr.is-selected > td, .prods-table tbody tr.is-selected:hover > td { background: #eef5fc; }

/* Cases (urgent, sélection) dans une zone de 40 × 40 */
.prods form .prods-check, .prods .prods-check { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; min-height: 0; margin: 0; border-radius: 8px; cursor: pointer; vertical-align: middle; }
.prods .prods-check:hover { background: rgba(0, 0, 0, .05); }
.prods .prods-check input { width: 20px; height: 20px; margin: 0; cursor: pointer; }
.prods .prods-check--urgent input { accent-color: #b02a37; }

/* Actions : étape (Peser / Conditionner) + menu « ⋯ » */
.prods-actions { width: 1%; white-space: nowrap; text-align: right; }
.prods-actions__in { display: flex; align-items: center; justify-content: flex-end; gap: 4px; }
/* touch.css agrandit les liens des cellules (inline-block, 10 px de marge) : sans objet pour ces boutons */
.layout-content .prods td > a.prods-btn { display: inline-flex; padding: 0; }
.page .prods-btn, .prods-btn { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border: 1px solid #dfe3e8; border-radius: 8px; background: #fff; color: #3d4752; cursor: pointer; list-style: none; vertical-align: middle; }
.prods-btn::-webkit-details-marker { display: none; }
.page .prods-btn:hover, .prods-btn:focus-visible, .prods-menu[open] > .prods-btn { border-color: #b9c3ce; background: #f1f4f7; color: var(--ui-blue, #0062cc); text-decoration: none; outline: none; }
.prods-btn:focus-visible { box-shadow: 0 0 0 3px rgba(0, 98, 204, .25); }
.layout-content .prods td > a.prods-btn--step, .page .prods-btn--step { width: auto; padding: 0 12px; gap: 6px; border-color: #b6d0ef; background: #eef5fc; color: var(--ui-navy, #0b3a6e); font-size: .875rem; font-weight: 600; }
.page .prods-btn--step:hover, .prods-btn--step:focus-visible { border-color: #0062cc; background: #e1edfa; color: var(--ui-navy, #0b3a6e); }
.page .prods-btn--condition, .layout-content .prods td > a.prods-btn--condition { border-color: #efd5a8; background: #fff6e6; color: #6b4000; }
.page .prods-btn--condition:hover, .prods-btn--condition:focus-visible { border-color: #a15c00; background: #ffefd2; color: #6b4000; }
.prods-menu { position: relative; display: inline-block; vertical-align: middle; }
.prods-menu__list { position: absolute; top: calc(100% + 4px); right: 0; z-index: 30; min-width: 250px; padding: 6px; border: 1px solid #dfe3e8; border-radius: 10px; background: #fff; box-shadow: 0 10px 30px rgba(16, 24, 40, .16); text-align: left; white-space: nowrap; }
.prods-menu.is-up .prods-menu__list { top: auto; bottom: calc(100% + 4px); }
.prods-menu__list .post-action { display: block; margin: 0; }
.page .prods-menu__item, .prods-menu__item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 40px; padding: 0 12px; border: 0; border-radius: 6px; background: none; color: var(--ui-ink, #212529); font-size: .925rem; line-height: 1.3; text-align: left; text-decoration: none; cursor: pointer; }
.prods-menu__item i { width: 16px; color: #6c757d; text-align: center; }
.page .prods-menu__item:hover, .prods-menu__item:hover, .prods-menu__item:focus { background: #f1f4f7; color: var(--ui-ink, #212529); text-decoration: none; outline: none; }
.prods-menu__item.prods-menu__item--danger, .prods-menu__item--danger i { color: #b02a37; }
.prods-menu__item.prods-menu__item--danger:hover, .prods-menu__item.prods-menu__item--danger:focus { background: #fbebeb; color: #b02a37; }
.prods-menu__sep { margin: 6px 4px; border-top: 1px solid #eef0f2; }
.layout-content.has-prods-menu { overflow: visible; } /* menus « ⋯ » des dernières lignes non coupés */

.prods-empty { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 40px 16px; border: 1px dashed var(--ui-line, #dee2e6); border-radius: 10px; background: #fafbfc; color: var(--ui-muted, #5f6b78); text-align: center; }
.prods-empty i { font-size: 2rem; color: #adb5bd; }
.prods-empty p { margin: 0; }

/* Message des enregistrements AJAX (avant : alert()) */
.prods-toast { position: fixed; bottom: 24px; left: 50%; z-index: 1060; max-width: calc(100vw - 32px); width: max-content; padding: 12px 18px; border-radius: 10px; background: #1e7e34; color: #fff; font-weight: 600; box-shadow: 0 10px 30px rgba(16, 24, 40, .25); transform: translateX(-50%); cursor: pointer; }
.prods-toast.is-error { background: #b02a37; }
.prods-toast[hidden] { display: none; }

/* Fenêtres Commentaire et Quantité */
.prods-modal .modal-title { margin: 0; font-size: 1.15rem; font-weight: 700; }
.prods-modal label { display: block; color: #3d4752; font-size: .9rem; font-weight: 600; text-transform: none; }
.prods-modal textarea.form-control { min-height: 88px; }
.prods-counter { margin: 4px 0 0; color: var(--ui-muted, #5f6b78); font-size: .82rem; }
#prods-comment-count { text-align: right; }
.prods-qty-current { margin: 0 0 12px; color: #3d4752; font-weight: 600; }
.prods-modal__error { margin: 10px 0 0; }
.prods-modal__error[hidden] { display: none; }

/* Moins de 1680 px (PC 1440, tablette paysage) : « Créé le » et l'étape passent sous le n° d'OF, pour que la ligne
   tienne sans défilement avec ses actions (avant : 14 colonnes, Actions et Sélection hors écran à 1440 px) */
.prods-md, .prods-sm { display: none; }
@media (max-width: 1679.98px) {
    .prods-col-xl { display: none; }
    .prods-of .prods-md { display: block; white-space: nowrap; }
    .page table.prods-table td { padding: 8px 6px; }
    .page table.prods-table thead th > span, .page a.prods-sort { padding: 0 6px; }
    .prods-card { min-width: 160px; }
    .prods-table:not(.prods-table--archive) tr.is-urgent > td:first-child { box-shadow: none; }
    .prods-table:not(.prods-table--archive) tr.is-urgent > td:nth-child(2) { box-shadow: inset 4px 0 0 #b02a37; }
}
/* Tablette (< 992 px) : client et n° de commande (texte, non modifiable) passent aussi dans la cellule Fiche */
@media (max-width: 991.98px) {
    .prods-col-lg { display: none; }
    .prods-head { flex-direction: column; align-items: flex-start; }
    .prods-filters__search { flex-basis: 100%; }
    .prods-of .prods-sm, .prods-card .prods-sm { display: block; }
    .prods-of .prods-md { white-space: normal; }
    .prods-of__step .prods-step { display: inline; font-size: .8rem; white-space: normal; }
    .prods-of__step .prods-step::before { display: inline-block; margin-right: 5px; vertical-align: 1px; }
    .page table.prods-table td { padding: 8px 5px; }
    .page table.prods-table thead th > span, .page a.prods-sort { padding: 0 5px; }
    .prods .prods-field--date { width: 100px; }
    .prods-card { min-width: 130px; }
    .prods-qty { white-space: normal; }
    /* Actions empilées : la ligne est déjà haute (fiche sur plusieurs lignes), la colonne reste étroite */
    .prods-actions__in { flex-direction: column; align-items: flex-end; }
}
@media (max-width: 767.98px) {
    .prods-table-wrap { overflow-x: auto; }
    .prods-head__actions { width: 100%; }
}
@media (pointer: coarse) {
    .prods .btn, .prods .form-control, .prods-modal .btn, .prods-menu__item, .page a.prods-tabs__tab { min-height: 44px; }
    .prods .prods-field { height: 44px; }
    .prods-btn, .page .prods-btn { width: 44px; height: 44px; }
    .layout-content .prods td > a.prods-btn--step, .page .prods-btn--step { width: auto; }
    .prods form .prods-check, .prods .prods-check { width: 44px; height: 44px; }
}

/* ---------------------------------------------------------------------------------------------------------------
 * Contrôle qualité (templates/Production/control.html.twig, « cq ») et pastilles CQ / n° de commande des archives :
 * s'appuie sur le bloc « prods » ci-dessus. Script : public/js/quality-control.js. Pleine largeur (aucune max-width).
 * Avant : DataTables, en-têtes en majuscules, colonnes en %, valeurs « 0 » pré-remplies, aucun écart affiché.
 * ------------------------------------------------------------------------------------------------------------- */
.cq-target { display: block; margin-bottom: 3px; color: var(--ui-muted, #5f6b78); font-size: .8rem; white-space: nowrap; }
.prods .cq-field { background: #fff; border-color: #cfd6de; text-align: right; }
.prods .cq-field--density { width: 96px; }
.prods .cq-field--nicotine { width: 80px; }
.prods .cq-field.is-invalid { border-color: #b02a37; }
/* Exemple de saisie bien distinct d'une valeur mesurée (avant : « 0 » pré-rempli) */
.prods .cq-field::placeholder { color: #a7b0ba; font-style: italic; opacity: 1; }
.cq-gap { display: block; min-height: 1.2em; margin-top: 3px; font-size: .8rem; font-weight: 600; white-space: nowrap; }
.cq-gap:empty { display: none; }
.cq-gap--ok { color: #1e7e34; }
.cq-gap--ko { color: #b02a37; }
.cq-value { font-weight: 600; font-variant-numeric: tabular-nums; }
.cq-density, .cq-nicotine { white-space: nowrap; }
.cq-step { display: flex; margin-top: 3px; font-size: .8rem; }
.cq-step--done { color: #5f6b78; }
.cq-form { display: inline-flex; margin: 0; }
.page .prods-btn--step.cq-validate[disabled] { border-color: #dfe3e8; background: #f6f7f9; color: #8a94a1; cursor: not-allowed; }
/* Contrôle hors tolérance : fond clair, filet rouge à gauche, pastille « Hors tolérance » (jamais la couleur seule) */
.prods-table tr.is-off > td { background: #fdf1f1; }
.prods-table tbody tr.is-off:hover > td { background: #fbe9e9; }
.prods-table tr.is-off > td:first-child { box-shadow: inset 4px 0 0 #b02a37; }
.page a.prods-head__late { text-decoration: underline; }

/* Archives : pastille du contrôle qualité (cellule Fiche) et n° de commande en texte entier */
.cq-badge { gap: 5px; margin-right: 4px; }
.cq-badge i { font-size: .85em; }
.cq-badge--ok { border-color: #b7dfc2; background: #eaf6ee; color: #1e6b31; }
.cq-badge--off { border-color: #b02a37; background: #fff; color: #b02a37; }
.page a.cq-badge--todo, .cq-badge--todo { border-color: #d6dbe1; background: #f6f7f9; color: #3d4752; text-decoration: none; }
.page a.cq-badge--todo:hover { border-color: #0062cc; color: var(--ui-blue, #0062cc); }
/* touch.css agrandit les liens des cellules (inline-block, 10 px de marge) : la pastille garde sa forme */
.layout-content .prods td > a.cq-badge { display: inline-flex; padding: 0 10px; }
.cq .prods-filters__period { flex-basis: 236px; }
.prods.cq .prods-filters__period .form-control { flex-basis: 115px; width: 115px; }
.prods-order__text { display: block; min-width: 90px; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.prods-closed { line-height: 1.35; }
.prods-order-warn { margin: 12px 0 0; font-size: .875rem; }

@media (max-width: 1679.98px) {
    .prods-table.cq-table tr.is-off > td:first-child { box-shadow: none; }
    .prods-table.cq-table tr.is-off > td:nth-child(2) { box-shadow: inset 4px 0 0 #b02a37; }
}
/* Tablette : la ligne garde N° d'OF, Fiche, Densité, Nicotine, Actions ; champs un peu plus étroits */
@media (max-width: 991.98px) {
    .prods .cq-field--density { width: 84px; }
    .prods .cq-field--nicotine { width: 64px; }
    .cq-table .prods-actions__in { flex-direction: row; }
}
@media (pointer: coarse) {
    .prods .cq-field { height: 44px; }
    .layout-content .prods td > a.cq-badge { min-height: 44px; margin-top: 4px; }
}

/* ---------------------------------------------------------------------------------------------------------------
 * Exports Excel (templates/Production/extracts.html.twig, « exp ») : cartes d'export par thème, sur le bloc « prods »
 * ci-dessus. Script : public/js/extracts.js. Pleine largeur (aucune max-width) ; grille de cartes : 3 colonnes à 1920,
 * 2 à 1440, 1 sur tablette. Avant : deux champs sans libellé et un bouton « extract » sur 8/12 colonnes.
 * ------------------------------------------------------------------------------------------------------------- */
.exp-head__desc { max-width: 900px; margin: 4px 0 0; color: var(--ui-muted, #5f6b78); font-size: .95rem; }
.exp-section { margin-top: 20px; }
.exp-section__title { margin: 0 0 10px; color: var(--ui-ink, #212529); font-size: 1.1rem; font-weight: 700; }
.exp-section__intro { margin: -4px 0 10px; color: var(--ui-muted, #5f6b78); font-size: .9rem; }
.exp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 440px), 1fr)); gap: 16px; }
.exp-card { display: flex; flex-direction: column; min-width: 0; padding: 16px; border: 1px solid #e3e6ea; border-radius: var(--ui-radius, 10px); background: #fff; }
.exp-card__head { display: flex; align-items: center; gap: 10px; }
.exp-card__icon { display: inline-flex; flex: none; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 8px; background: #eef5fc; color: var(--ui-navy, #0b3a6e); }
.page .exp-card__title { flex: 1 1 auto; min-width: 0; margin: 0; color: var(--ui-ink, #212529); font-size: 1.05rem; font-weight: 700; line-height: 1.3; text-transform: none; }
.exp-badge { flex: none; margin-top: 0; border-color: #b7dfc2; background: #eaf6ee; color: #1e6b31; }
.exp-card__desc { margin: 8px 0 0; color: var(--ui-muted, #5f6b78); font-size: .9rem; line-height: 1.45; }
.exp-card__form { display: flex; flex: 1 1 auto; flex-direction: column; margin: 12px 0 0; padding-top: 12px; border-top: 1px solid #eef0f2; }
.exp-card__note { margin: 0; color: #3d4752; font-size: .9rem; }
.exp-filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 12px; }
.exp-field { display: flex; flex: 1 1 190px; flex-direction: column; min-width: 0; }
.exp-field--wide { flex-basis: 100%; }
.exp-field--date { flex: 0 1 150px; min-width: 130px; }
.exp-field--search { flex: 2 1 200px; }
.exp-field--reset { flex: 0 0 auto; }
.prods form .exp-field__label, .exp-field__label { display: block; margin: 0 0 4px; color: #3d4752; font-size: .85rem; font-weight: 600; text-transform: none; }
.exp-field__help { margin: 6px 0 0; color: var(--ui-muted, #5f6b78); font-size: .82rem; }
.prods .exp-filters .form-control { width: 100%; font-size: .9rem; }
.prods .exp-reset { min-height: 40px; padding: 0 6px; color: var(--ui-blue, #0062cc); font-size: .9rem; }
/* Raccourcis de période : barre segmentée des productions, boutons au lieu de liens */
.exp-shortcuts { align-self: flex-start; }
.prods .exp-shortcut { display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border: 0; border-radius: 8px; background: transparent; color: var(--ui-ink, #212529); font-size: .9rem; font-weight: 600; cursor: pointer; }
.prods .exp-shortcut:hover { background: rgba(255, 255, 255, .6); }
.prods .exp-shortcut[aria-pressed="true"] { background: #fff; color: var(--ui-navy, #0b3a6e); box-shadow: 0 1px 3px rgba(0, 0, 0, .14); }
.exp-shortcut:focus-visible { outline: 2px solid var(--ui-blue, #0062cc); outline-offset: 1px; }
.exp-error { margin: 6px 0 0; color: #b02a37; font-size: .85rem; font-weight: 600; }
.exp-card__estimate { min-height: 1.4em; margin: 12px 0 0; color: #3d4752; font-size: .9rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.exp-card__estimate.is-empty { color: #8a4f00; }
.exp-card__estimate.is-heavy { color: #8a4f00; }
.exp-card__estimate.is-error { color: #b02a37; }
.exp-cols { margin: 8px 0 0; }
.exp-cols__toggle { display: inline-flex; align-items: center; min-height: 40px; color: var(--ui-blue, #0062cc); font-size: .9rem; font-weight: 600; cursor: pointer; }
.exp-cols__list { columns: 2 200px; column-gap: 24px; margin: 4px 0 0; padding-left: 22px; color: #3d4752; font-size: .82rem; line-height: 1.6; }
.exp-cols__list li { break-inside: avoid; }
.exp-cols__new { padding: 0 6px; border-radius: 999px; background: #eef5fc; color: var(--ui-navy, #0b3a6e); font-size: .72rem; font-weight: 700; }
/* Pied de carte en bas : les cartes d'une même rangée alignent leur bouton */
.exp-card__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: auto; padding-top: 12px; }
.prods .exp-card__btn { min-width: 210px; }
.prods .exp-card__btn[disabled] { cursor: not-allowed; opacity: .55; }
.prods .exp-card__btn.is-loading { opacity: .8; }
.prods .exp-card__btn.is-loading::after { display: none; }
.exp-card__btn.is-loading .fa { animation: ui-spin .9s linear infinite; }
.exp-card__file { min-width: 0; color: var(--ui-muted, #5f6b78); font-family: SFMono-Regular, Menlo, Consolas, monospace; font-size: .78rem; overflow-wrap: anywhere; }
.exp-card__status { margin: 10px 0 0; padding: 8px 12px; border-radius: 8px; background: #eef5fc; color: var(--ui-navy, #0b3a6e); font-size: .85rem; }
.exp-card__status.is-done { background: #eaf6ee; color: #1e6b31; }
.exp-card__status.is-warn { background: #fff6e6; color: #6b4000; }
.exp-card__status[hidden] { display: none; }
/* Liens vers les exports qui dépendent des filtres de leur page */
.exp-links { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 8px 16px; margin: 0; padding: 0; list-style: none; }
.page a.exp-link { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; padding: 8px 14px; border: 1px solid #e3e6ea; border-radius: var(--ui-radius, 10px); background: #fff; color: var(--ui-ink, #212529); text-decoration: none; }
.page a.exp-link:hover, .page a.exp-link:focus { border-color: #b6d0ef; background: #f5f9fd; color: var(--ui-ink, #212529); text-decoration: none; }
.exp-link__text { display: flex; flex-direction: column; min-width: 0; }
.exp-link__text span { color: var(--ui-muted, #5f6b78); font-size: .82rem; }
.exp-link .fa { flex: none; color: #8a94a1; }
@media (max-width: 991.98px) {
    .exp-card__foot .exp-card__btn { flex: 1 1 100%; }
    .exp-field--date { flex: 1 1 140px; }
}
@media (pointer: coarse) {
    .prods .exp-shortcut, .exp-cols__toggle, .prods .exp-reset { min-height: 44px; }
}
