/*
 * RG Production - Thème commun
 * Version : 2026-08-19
 *
 * Deux ambiances :
 *   - muted : ardoise / terne, claire et peu contrastée
 *   - dark  : bleu nuit, inspirée du rapport "Analyse historique"
 *
 * Le thème est choisi avec data-theme sur <html>.
 */

/* ============================================================
   VARIABLES DE THEME
   ============================================================ */

:root,
html[data-theme="muted"] {
    color-scheme: light;

    --bg: #e7ebef;
    --surface: #f5f7f9;
    --surface-2: #edf1f4;
    --surface-hover: #e6ebef;

    --header: #252d36;
    --header-text: #f8fafc;

    --text: #26313b;
    --text-strong: #151d25;
    --muted: #687684;
    --muted-2: #8b98a4;

    --border: #d4dbe2;
    --border-strong: #c1cbd4;

    --shadow: 0 8px 24px rgba(32, 45, 58, 0.08);
    --shadow-soft: 0 4px 14px rgba(32, 45, 58, 0.06);

    --accent: #2d7fae;
    --accent-soft: #dcecf6;

    --specific-bg: #d9eef0;
    --specific-text: #0d6a73;
    --specific-dot: #b8dfe2;

    --generic-bg: #e8e0f5;
    --generic-text: #644595;
    --generic-dot: #d4c5ec;

    --waiting-bg: #f8e5bd;
    --waiting-text: #875100;
    --waiting-border: #e7ba61;
    --waiting-dot: #e3b04b;

    --ready-bg: #d8eaf6;
    --ready-text: #17668f;

    --sent-bg: #dfe3f1;
    --sent-text: #4a5d88;

    --download-bg: #dce9f6;
    --download-text: #2a6898;

    --downloaded-bg: #dbeee1;
    --downloaded-text: #267044;

    --error-bg: #f4dddd;
    --error-text: #9a3030;

    --neutral-bg: #e6eaee;
    --neutral-text: #5e6974;

    --purple: #7859ad;
    --teal: #2d9098;
    --orange: #d6941c;
    --blue: #3188b9;
    --indigo: #6976a8;
    --green: #43a067;
    --red: #cf5a5a;
}

html[data-theme="dark"] {
    color-scheme: dark;

    --bg: #08111f;
    --surface: #101b2d;
    --surface-2: #132136;
    --surface-hover: #172840;

    --header: #0b1525;
    --header-text: #f4f8fd;

    --text: #dce6f2;
    --text-strong: #f8fbff;
    --muted: #93a5bb;
    --muted-2: #71839a;

    --border: #273a53;
    --border-strong: #36506f;

    --shadow: 0 10px 28px rgba(0, 0, 0, 0.25);
    --shadow-soft: 0 5px 18px rgba(0, 0, 0, 0.18);

    --accent: #2d8bc2;
    --accent-soft: #15324a;

    --specific-bg: #15343b;
    --specific-text: #73d2da;
    --specific-dot: #23515a;

    --generic-bg: #2b2142;
    --generic-text: #c0a8ee;
    --generic-dot: #49366f;

    --waiting-bg: #3a2b13;
    --waiting-text: #f4c669;
    --waiting-border: #74531e;
    --waiting-dot: #ad7a25;

    --ready-bg: #143149;
    --ready-text: #80c8ef;

    --sent-bg: #252b47;
    --sent-text: #aab5e6;

    --download-bg: #153147;
    --download-text: #8bc8ee;

    --downloaded-bg: #183825;
    --downloaded-text: #84d69f;

    --error-bg: #3f2025;
    --error-text: #f09a9a;

    --neutral-bg: #202c3b;
    --neutral-text: #a7b4c4;

    --purple: #9678cf;
    --teal: #4eb6bd;
    --orange: #e9a12c;
    --blue: #3c9bd1;
    --indigo: #7c89bd;
    --green: #55b879;
    --red: #df6d6d;
}


/* ============================================================
   BASE
   ============================================================ */

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

body {
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family:
        "Segoe UI",
        Arial,
        Helvetica,
        sans-serif;
    transition:
        background-color .18s ease,
        color .18s ease;
}


/* ============================================================
   ENTETE
   ============================================================ */

header {
    min-height: 68px;
    padding: 0 26px;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;

    background: var(--header);
    color: var(--header-text);

    border-bottom: 1px solid var(--border);
}

.brand {
    font-size: 22px;
    font-weight: 750;
    letter-spacing: .1px;
    white-space: nowrap;
}

.header-user {
    display: flex;
    align-items: center;
    gap: 18px;
    font-size: 13px;
}

.header-user-name,
.header-user a {
    color: var(--header-text);
}

.header-user a {
    text-decoration: none;
}

.header-user a:hover {
    text-decoration: underline;
}


/* ============================================================
   SELECTEUR DE THEME
   ============================================================ */

.theme-switcher {
    display: inline-flex;
    align-items: center;
    gap: 4px;

    padding: 4px;

    border: 1px solid var(--border-strong);
    border-radius: 9px;

    background: rgba(255, 255, 255, 0.035);
}

.theme-switcher button {
    border: 0;
    border-radius: 6px;
    padding: 7px 10px;

    background: transparent;
    color: var(--muted);

    font: inherit;
    font-size: 12px;
    font-weight: 650;

    cursor: pointer;
}

.theme-switcher button:hover {
    color: var(--header-text);
    background: rgba(255, 255, 255, 0.06);
}

.theme-switcher button.is-active {
    color: #ffffff;
    background: var(--accent);
}


/* ============================================================
   CONTENU
   ============================================================ */

main {
    max-width: 1500px;
    margin: 0 auto;
    padding: 34px 26px 50px;
}

h1 {
    margin: 0 0 28px;
    color: var(--text-strong);
    font-size: 30px;
    font-weight: 760;
    letter-spacing: -.3px;
}

.section-heading {
    margin: 36px 0 17px;

    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
}

.section-heading.first {
    margin-top: 0;
}

.section-title {
    margin: 0;
    color: var(--text-strong);
    font-size: 21px;
    font-weight: 730;
}

.section-subtitle {
    margin-top: 5px;
    color: var(--muted);
    font-size: 13px;
}


/* ============================================================
   ALERTES
   ============================================================ */

.alert {
    margin-bottom: 18px;
    padding: 15px 18px;

    border-radius: 9px;

    font-size: 14px;
    line-height: 1.45;
}

.alert-warning {
    background: var(--waiting-bg);
    color: var(--waiting-text);
    border: 1px solid var(--waiting-border);
}

.alert-error {
    background: var(--error-bg);
    color: var(--error-text);
    border: 1px solid color-mix(in srgb, var(--error-text) 35%, transparent);
}


/* ============================================================
   CARTES
   ============================================================ */

.cards {
    display: grid;
    gap: 14px;
    margin-bottom: 24px;
}

.order-cards {
    grid-template-columns: repeat(6, minmax(0, 1fr));
}

.catalog-cards {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.card {
    position: relative;

    min-height: 112px;
    padding: 18px;

    background: var(--surface);

    border: 1px solid var(--border);
    border-top: 4px solid transparent;
    border-radius: 11px;

    box-shadow: var(--shadow-soft);

    transition:
        transform .16s ease,
        border-color .16s ease,
        background-color .16s ease;
}

.card:hover {
    transform: translateY(-1px);
    background: var(--surface-2);
    border-color: var(--border-strong);
}

.card-value {
    color: var(--text-strong);
    font-size: 29px;
    font-weight: 760;
    line-height: 1;
}

.card-label {
    margin-top: 11px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.25;
}

.card-detail {
    margin-top: 6px;
    color: var(--muted-2);
    font-size: 11px;
}

.card-warning { border-top-color: var(--orange); }
.card-ready { border-top-color: var(--blue); }
.card-sent { border-top-color: var(--indigo); }
.card-downloaded { border-top-color: var(--green); }
.card-error { border-top-color: var(--red); }
.card-specific { border-top-color: var(--teal); }
.card-generic { border-top-color: var(--purple); }
.card-missing { border-top-color: var(--red); }

.card-warning .card-value { color: var(--orange); }
.card-ready .card-value { color: var(--blue); }
.card-sent .card-value { color: var(--indigo); }
.card-downloaded .card-value { color: var(--green); }
.card-error .card-value { color: var(--red); }
.card-specific .card-value { color: var(--teal); }
.card-generic .card-value { color: var(--purple); }
.card-missing .card-value { color: var(--red); }

.card-label::before {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 20px;
    height: 20px;
    margin-right: 7px;

    border-radius: 6px;

    font-size: 11px;
    font-weight: 900;

    vertical-align: -3px;
}

.card-warning .card-label::before {
    content: "!";
    background: var(--waiting-bg);
    color: var(--waiting-text);
}

.card-ready .card-label::before {
    content: "✓";
    background: var(--ready-bg);
    color: var(--ready-text);
}

.card-sent .card-label::before {
    content: "→";
    background: var(--sent-bg);
    color: var(--sent-text);
}

.card-downloaded .card-label::before {
    content: "↓";
    background: var(--downloaded-bg);
    color: var(--downloaded-text);
}

.card-error .card-label::before {
    content: "×";
    background: var(--error-bg);
    color: var(--error-text);
}

.card-specific .card-label::before {
    content: "S";
    background: var(--specific-bg);
    color: var(--specific-text);
}

.card-generic .card-label::before {
    content: "G";
    background: var(--generic-bg);
    color: var(--generic-text);
}

.card-missing .card-label::before {
    content: "!";
    background: var(--error-bg);
    color: var(--error-text);
}


/* ============================================================
   PANNEAUX
   ============================================================ */

.panel {
    overflow: hidden;

    background: var(--surface);

    border: 1px solid var(--border);
    border-radius: 11px;

    box-shadow: var(--shadow);
}

.panel + .panel {
    margin-top: 20px;
}

.panel-title {
    padding: 18px 20px;

    color: var(--text-strong);

    border-bottom: 1px solid var(--border);

    font-size: 17px;
    font-weight: 720;
}


/* ============================================================
   TABLEAUX
   ============================================================ */

.table-wrapper {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 13px 16px;

    border-bottom: 1px solid var(--border);

    text-align: left;
    vertical-align: middle;
}

th {
    color: var(--muted);
    font-size: 12px;
    font-weight: 650;
    white-space: nowrap;
}

td {
    color: var(--text);
    font-size: 13px;
}

tbody tr:last-child td {
    border-bottom: 0;
}

tbody tr:hover {
    background: var(--surface-hover);
}

.rgprod-order-row--cancelled > td {
    background: var(--error-bg);
}

.rgprod-order-row--cancelled > td:first-child {
    border-left: 4px solid var(--red);
}

.rgprod-cancelled-history {
    color: var(--muted);
    font-size: 12px;
    font-weight: 650;
}

.rgprod-cancellation-preview-row > td {
    padding: 0 12px 14px;
    background: var(--error-bg);
}

.rgprod-cancellation-preview {
    padding: 14px 16px;
    border: 1px solid var(--red);
    border-left: 4px solid var(--error-text);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
}

.rgprod-cancellation-preview-title {
    margin-bottom: 8px;
    color: var(--error-text);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .04em;
}

.rgprod-cancellation-preview ul {
    margin: 9px 0;
    padding-left: 20px;
}

.rgprod-cancellation-preview-suppliers {
    margin: 10px 0;
    padding: 10px 12px;
    border-radius: 7px;
    background: var(--surface-2);
}

.rgprod-cancellation-preview-action {
    margin-top: 10px;
    color: var(--error-text);
    font-weight: 800;
}


/* ============================================================
   COMMANDES
   ============================================================ */

.order-reference {
    color: var(--text-strong);
    font-weight: 700;
    white-space: nowrap;
}

.order-link,
.product-link {
    color: var(--text-strong);
    text-decoration: none;
}

.order-link:hover,
.product-link:hover {
    color: var(--accent);
    text-decoration: none;
}

.order-id,
.small-muted,
.reference {
    color: var(--muted);
}

.order-id {
    margin-top: 3px;
    font-size: 11px;
}

.order-customer {
    color: var(--text-strong);
    font-weight: 650;
}

.small-muted {
    margin-top: 3px;
    font-size: 11px;
    line-height: 1.35;
}

.resolution {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.resolution-chip {
    display: inline-block;
    padding: 4px 8px;

    border: 1px solid transparent;
    border-radius: 999px;

    background: var(--neutral-bg);
    color: var(--neutral-text);

    font-size: 11px;
    font-weight: 700;
}

.resolution-specific {
    background: var(--specific-bg);
    color: var(--specific-text);
}

.resolution-generic,
.resolution-manual {
    background: var(--generic-bg);
    color: var(--generic-text);
}

.resolution-missing {
    background: var(--error-bg);
    color: var(--error-text);
}

.resolution-specific::before,
.resolution-generic::before,
.resolution-missing::before {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 16px;
    height: 16px;
    margin-right: 5px;

    border-radius: 50%;

    font-size: 9px;
    font-weight: 800;
}

.resolution-specific::before {
    content: "S";
    background: var(--specific-dot);
    color: var(--specific-text);
}

.resolution-generic::before {
    content: "G";
    background: var(--generic-dot);
    color: var(--generic-text);
}

.resolution-missing::before {
    content: "!";
    background: color-mix(in srgb, var(--error-text) 22%, transparent);
    color: var(--error-text);
}


/* ============================================================
   PRODUIT
   ============================================================ */

.product-name {
    color: var(--text-strong);
    font-weight: 700;
}

.reference {
    margin-top: 3px;
    font-size: 12px;
}


/* ============================================================
   BADGES DE STATUT
   ============================================================ */

.status {
    display: inline-block;

    padding: 5px 9px;

    border: 1px solid transparent;
    border-radius: 20px;

    text-align: center;

    font-size: 11px;
    font-weight: 700;
    line-height: 1.2;

    white-space: nowrap;
}

.status-specific {
    min-width: 72px;
    background: var(--specific-bg);
    color: var(--specific-text);
}

.status-generic {
    min-width: 72px;
    background: var(--generic-bg);
    color: var(--generic-text);
}

.status-missing {
    min-width: 72px;
    background: var(--error-bg);
    color: var(--error-text);
}

.status-neutral {
    background: var(--neutral-bg);
    color: var(--neutral-text);
}

.status-waiting {
    background: var(--waiting-bg);
    color: var(--waiting-text);
    border-color: var(--waiting-border);
}

.status-ready {
    background: var(--ready-bg);
    color: var(--ready-text);
}

.status-sent {
    background: var(--sent-bg);
    color: var(--sent-text);
}

.status-download {
    background: var(--download-bg);
    color: var(--download-text);
}

.status-downloaded,
.status-completed {
    background: var(--downloaded-bg);
    color: var(--downloaded-text);
}

.status-error {
    background: var(--error-bg);
    color: var(--error-text);
}

.status-muted {
    background: var(--neutral-bg);
    color: var(--neutral-text);
}

.status-specific::before,
.status-generic::before,
.status-missing::before,
.status-waiting::before {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 17px;
    height: 17px;
    margin-right: 6px;

    border-radius: 50%;

    font-size: 9px;
    font-weight: 900;

    vertical-align: -1px;
}

.status-specific::before {
    content: "S";
    background: var(--specific-dot);
    color: var(--specific-text);
}

.status-generic::before {
    content: "G";
    background: var(--generic-dot);
    color: var(--generic-text);
}

.status-missing::before {
    content: "!";
    background: color-mix(in srgb, var(--error-text) 22%, transparent);
    color: var(--error-text);
}

.status-waiting::before {
    content: "!";
    background: var(--waiting-dot);
    color: #ffffff;
}

.status-ready::before {
    content: "✓";
    margin-right: 6px;
    font-weight: 900;
}

.status-sent::before {
    content: "→";
    margin-right: 6px;
    font-weight: 900;
}

.status-error::before {
    content: "×";
    margin-right: 6px;
    font-weight: 900;
}


/* ============================================================
   TELECHARGEMENTS
   ============================================================ */

.download-progress {
    color: var(--text-strong);
    font-weight: 700;
}

.download-ok {
    color: var(--downloaded-text);
}

.download-pending {
    color: var(--muted);
}


/* ============================================================
   VIDE
   ============================================================ */

.empty {
    padding: 35px 24px;
    color: var(--muted);
    text-align: center;
}


/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 1250px) {
    .order-cards {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .catalog-cards {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 820px) {
    header {
        padding: 14px 18px;
        align-items: flex-start;
    }

    .header-user {
        flex-wrap: wrap;
        justify-content: flex-end;
    }

    .theme-switcher {
        order: 3;
        width: 100%;
        justify-content: flex-end;
    }

    main {
        padding: 25px 15px 40px;
    }

    .order-cards,
    .catalog-cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    th,
    td {
        padding: 11px 12px;
    }
}

@media (max-width: 520px) {
    header {
        flex-direction: column;
    }

    .header-user {
        width: 100%;
        justify-content: space-between;
    }

    .theme-switcher {
        justify-content: stretch;
    }

    .theme-switcher button {
        flex: 1;
    }

    .order-cards,
    .catalog-cards {
        grid-template-columns: 1fr;
    }
}


/* ============================================================
   INTERFACE ADMINISTRATEUR COMMUNE
   Version centralisée : 2026-08-20

   Cette section permet aux anciennes pages RG Production,
   qui possèdent encore leur CSS de mise en page local,
   d'utiliser les mêmes couleurs Ardoise / Sombre que index.php.

   Le fichier rgprod.css est chargé APRES le CSS local de chaque page :
   les géométries spécifiques restent donc en place tandis que
   couleurs, surfaces, bordures et contrôles deviennent communs.
   ============================================================ */

body.rgprod-admin,
body.rgprod-login {
    background: var(--bg);
    color: var(--text);
    font-family:
        "Segoe UI",
        Arial,
        Helvetica,
        sans-serif;
}

body.rgprod-admin header,
body.rgprod-admin .topbar {
    background: var(--header);
    color: var(--header-text);
    border-bottom: 1px solid var(--border);
}

body.rgprod-admin header .brand,
body.rgprod-admin .topbar .brand,
body.rgprod-admin header > strong:first-child {
    color: var(--header-text);
    font-size: 22px;
    font-weight: 750;
    text-decoration: none;
}

body.rgprod-admin header a,
body.rgprod-admin .topbar a {
    color: var(--header-text);
}

body.rgprod-admin .header-user,
body.rgprod-admin .header-right,
body.rgprod-admin .topbar > div:last-child {
    display: flex;
    align-items: center;
    gap: 16px;
    color: var(--header-text);
}

body.rgprod-admin main {
    color: var(--text);
}

body.rgprod-admin h1,
body.rgprod-admin h2,
body.rgprod-admin h3,
body.rgprod-admin h4,
body.rgprod-admin .panel-title,
body.rgprod-admin .item-title,
body.rgprod-admin .action-title,
body.rgprod-admin .supplier-name,
body.rgprod-admin .set-name,
body.rgprod-admin .file-name,
body.rgprod-admin .history-revision,
body.rgprod-admin .summary-value,
body.rgprod-admin .value {
    color: var(--text-strong);
}

body.rgprod-admin .subtitle,
body.rgprod-admin .back,
body.rgprod-admin .info,
body.rgprod-admin .small,
body.rgprod-admin .small-muted,
body.rgprod-admin .muted,
body.rgprod-admin .product-meta,
body.rgprod-admin .file-meta,
body.rgprod-admin .item-reference,
body.rgprod-admin .supplier-meta,
body.rgprod-admin .summary-label,
body.rgprod-admin .attribute-name,
body.rgprod-admin .history-date,
body.rgprod-admin .mail-label,
body.rgprod-admin .label {
    color: var(--muted);
}

body.rgprod-admin .back:hover {
    color: var(--accent);
}

body.rgprod-admin .panel,
body.rgprod-admin .card,
body.rgprod-admin .box {
    background: var(--surface);
    color: var(--text);
    border-color: var(--border);
    box-shadow: var(--shadow-soft);
}

body.rgprod-admin .panel-title {
    border-bottom-color: var(--border);
}

body.rgprod-admin .panel-body,
body.rgprod-admin .panel-content {
    color: var(--text);
}

body.rgprod-admin .summary-item,
body.rgprod-admin .item-box,
body.rgprod-admin .supplier-card,
body.rgprod-admin .action-box,
body.rgprod-admin .summary,
body.rgprod-admin .file,
body.rgprod-admin .history-file,
body.rgprod-admin .history-header,
body.rgprod-admin .upload-zone,
body.rgprod-admin .confirmation,
body.rgprod-admin .confirm,
body.rgprod-admin .public-link,
body.rgprod-admin .mail-preview,
body.rgprod-admin .mail-body-preview,
body.rgprod-admin .filters,
body.rgprod-admin .warning-note {
    background: var(--surface-2);
    color: var(--text);
    border-color: var(--border);
}

body.rgprod-admin .attribute-row,
body.rgprod-admin .attribute-line,
body.rgprod-admin .order-item,
body.rgprod-admin th,
body.rgprod-admin td,
body.rgprod-admin .history-file {
    border-color: var(--border);
}

body.rgprod-admin tbody tr:hover {
    background: var(--surface-hover);
}

body.rgprod-admin th {
    color: var(--muted);
}

body.rgprod-admin td {
    color: var(--text);
}

body.rgprod-admin a {
    color: var(--accent);
}

body.rgprod-admin a.brand,
body.rgprod-admin header a,
body.rgprod-admin .topbar a {
    color: var(--header-text);
}

body.rgprod-admin input[type="text"],
body.rgprod-admin input[type="number"],
body.rgprod-admin input[type="email"],
body.rgprod-admin input[type="password"],
body.rgprod-admin input[type="date"],
body.rgprod-admin input[type="datetime-local"],
body.rgprod-admin input[type="file"],
body.rgprod-admin select,
body.rgprod-admin textarea {
    background: var(--surface-2);
    color: var(--text-strong);
    border: 1px solid var(--border-strong);
}

body.rgprod-admin input:focus,
body.rgprod-admin select:focus,
body.rgprod-admin textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent);
}

body.rgprod-admin input::placeholder,
body.rgprod-admin textarea::placeholder {
    color: var(--muted-2);
}

body.rgprod-admin button,
body.rgprod-admin .btn,
body.rgprod-admin .button,
body.rgprod-admin .download-link,
body.rgprod-admin .transmission-link {
    background: var(--accent);
    color: #ffffff;
    border-color: transparent;
}

body.rgprod-admin button:hover,
body.rgprod-admin .btn:hover,
body.rgprod-admin .button:hover,
body.rgprod-admin .download-link:hover,
body.rgprod-admin .transmission-link:hover {
    filter: brightness(1.08);
    text-decoration: none;
}

body.rgprod-admin button.secondary,
body.rgprod-admin .secondary,
body.rgprod-admin .button-light {
    background: var(--neutral-bg);
    color: var(--neutral-text);
    border: 1px solid var(--border);
}

body.rgprod-admin button:disabled,
body.rgprod-admin .btn:disabled {
    opacity: .52;
    cursor: not-allowed;
}

body.rgprod-admin .message-success,
body.rgprod-admin .ok {
    background: var(--downloaded-bg);
    color: var(--downloaded-text);
    border-color: color-mix(in srgb, var(--downloaded-text) 25%, transparent);
}

body.rgprod-admin .message-error,
body.rgprod-admin .err,
body.rgprod-admin .error {
    background: var(--error-bg);
    color: var(--error-text);
    border-color: color-mix(in srgb, var(--error-text) 28%, transparent);
}

body.rgprod-admin .message-warning,
body.rgprod-admin .warning-note,
body.rgprod-admin .next-step-alert,
body.rgprod-admin .update-modal-warning {
    background: var(--waiting-bg);
    color: var(--waiting-text);
    border-color: var(--waiting-border);
}

body.rgprod-admin .generic-badge,
body.rgprod-admin .status-generic,
body.rgprod-admin .resolution-generic,
body.rgprod-admin .resolution-manual {
    background: var(--generic-bg);
    color: var(--generic-text);
}

body.rgprod-admin .status-specific,
body.rgprod-admin .resolution-specific {
    background: var(--specific-bg);
    color: var(--specific-text);
}

body.rgprod-admin .status-missing,
body.rgprod-admin .resolution-missing,
body.rgprod-admin .badge-error {
    background: var(--error-bg);
    color: var(--error-text);
}

body.rgprod-admin .status-waiting,
body.rgprod-admin .badge-warning {
    background: var(--waiting-bg);
    color: var(--waiting-text);
    border-color: var(--waiting-border);
}

body.rgprod-admin .status-ready,
body.rgprod-admin .badge-ok {
    background: var(--ready-bg);
    color: var(--ready-text);
}

body.rgprod-admin .order-import-row--cancelled {
    background: #fdecec;
    border-left: 4px solid #d64545;
}

body.rgprod-admin .order-import-row--pending {
    background: #f5f3ee;
    border-left: 4px solid #9a8b72;
}

html[data-theme="dark"] body.rgprod-admin .order-import-row--cancelled {
    background: #3b2427;
}

html[data-theme="dark"] body.rgprod-admin .order-import-row--pending {
    background: #302d28;
}

body.rgprod-admin .status-sent {
    background: var(--sent-bg);
    color: var(--sent-text);
}

body.rgprod-admin .status-download {
    background: var(--download-bg);
    color: var(--download-text);
}

body.rgprod-admin .status-downloaded,
body.rgprod-admin .status-completed {
    background: var(--downloaded-bg);
    color: var(--downloaded-text);
}

body.rgprod-admin .status-neutral,
body.rgprod-admin .status-muted,
body.rgprod-admin .badge {
    background: var(--neutral-bg);
    color: var(--neutral-text);
}

body.rgprod-admin .file-ok {
    color: var(--downloaded-text);
}

body.rgprod-admin .file-error,
body.rgprod-admin .file-missing {
    color: var(--error-text);
}

body.rgprod-admin code,
body.rgprod-admin pre {
    color: var(--text-strong);
    background: var(--surface-2);
    border-color: var(--border);
}

body.rgprod-admin .update-modal-overlay {
    background: rgba(5, 10, 16, .56);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

body.rgprod-admin .update-modal {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}


/* ------------------------------------------------------------
   Page de connexion
   ------------------------------------------------------------ */

body.rgprod-login {
    background:
        radial-gradient(
            circle at 50% 10%,
            color-mix(in srgb, var(--accent) 16%, var(--bg)),
            var(--bg) 45%
        );
}

body.rgprod-login .login-box {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

body.rgprod-login .logo {
    color: var(--text-strong);
}

body.rgprod-login .subtitle,
body.rgprod-login .version {
    color: var(--muted);
}

body.rgprod-login input {
    background: var(--surface-2);
    color: var(--text-strong);
    border: 1px solid var(--border-strong);
}

body.rgprod-login input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent);
}

body.rgprod-login button {
    background: var(--accent);
    color: #ffffff;
}

body.rgprod-login .error {
    background: var(--error-bg);
    color: var(--error-text);
}


/* ------------------------------------------------------------
   Responsive commun
   ------------------------------------------------------------ */

@media (max-width: 820px) {
    body.rgprod-admin .header-user,
    body.rgprod-admin .header-right,
    body.rgprod-admin .topbar > div:last-child {
        flex-wrap: wrap;
        justify-content: flex-end;
    }
}

@media (max-width: 560px) {
    body.rgprod-admin .theme-switcher {
        width: 100%;
    }

    body.rgprod-admin .theme-switcher button {
        flex: 1;
    }
}

/* ============================================================
   FOURNISSEURS / ASSOCIATION PRODUCTION
   ============================================================ */

.rgprod-admin-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 0 20px;
}

.rgprod-admin-action {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: var(--surface);
    color: var(--text-strong) !important;
    text-decoration: none;
    box-shadow: var(--shadow-soft);
    font-size: 13px;
    font-weight: 700;
}

.rgprod-admin-action:hover {
    border-color: var(--accent);
    background: var(--surface-hover);
    text-decoration: none;
}

.supplier-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin: 16px 0;
}

.supplier-summary-card {
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    box-shadow: var(--shadow-soft);
}

.supplier-summary-value {
    color: var(--text-strong);
    font-size: 25px;
    font-weight: 800;
}

.supplier-summary-label {
    margin-top: 3px;
    color: var(--muted);
    font-size: 12px;
}

.supplier-management-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(300px, .85fr);
    gap: 16px;
    align-items: start;
}

.rgprod-form {
    display: grid;
    gap: 14px;
    padding: 18px;
    min-width: 0;
}

.rgprod-form p {
    margin: 0;
}

.rgprod-form label {
    display: block;
    overflow-wrap: anywhere;
}

.rgprod-form fieldset {
    min-width: 0;
}

.rgprod-form input[type="number"],
.rgprod-form select {
    display: block;
    width: 100%;
    min-width: 0;
    min-height: 40px;
    margin-top: 6px;
    padding: 9px 10px;
    border-radius: 7px;
}

.rgprod-form button {
    max-width: 100%;
    white-space: normal;
}

.supplier-form {
    display: grid;
    gap: 14px;
}

.supplier-form label {
    display: grid;
    gap: 6px;
}

.supplier-form label > span {
    color: var(--text-strong);
    font-size: 12px;
    font-weight: 700;
}

.supplier-form input[type="text"],
.supplier-form input[type="email"],
.supplier-form select,
.production-supplier-form select,
.production-upload-supplier select {
    width: 100%;
    min-height: 40px;
    padding: 9px 10px;
    border-radius: 7px;
}

.supplier-check {
    display: flex !important;
    align-items: center;
    gap: 8px !important;
}

.supplier-check input {
    width: auto;
}

.supplier-help {
    color: var(--muted);
    font-size: 11px;
    line-height: 1.45;
}

.supplier-form-actions,
.supplier-row-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.supplier-form-actions .btn,
.supplier-row-actions .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 8px 12px;
    border-radius: 7px;
    text-decoration: none;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

body.rgprod-admin .btn.danger {
    background: var(--error-bg);
    color: var(--error-text);
    border: 1px solid color-mix(in srgb, var(--error-text) 30%, transparent);
}

body.rgprod-admin .btn.danger:disabled {
    opacity: .42;
    cursor: not-allowed;
    filter: none;
}

.supplier-rule p {
    margin-top: 0;
    line-height: 1.55;
}

.supplier-rule-flow {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 14px 0;
}

.supplier-rule-flow span {
    padding: 7px 9px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: var(--surface-2);
    color: var(--text-strong);
    font-size: 11px;
    font-weight: 700;
}

.supplier-list-panel {
    margin-top: 16px;
}

.supplier-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 15px;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}

.supplier-row:last-child {
    border-bottom: 0;
}

.supplier-row.is-inactive {
    opacity: .70;
}

.supplier-name-line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.supplier-email {
    display: inline-block;
    margin-top: 4px;
    font-size: 12px;
}

.supplier-usage {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 8px;
}

.supplier-usage span {
    padding: 4px 7px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface-2);
    color: var(--muted);
    font-size: 10px;
}

.supplier-row-actions form {
    margin: 0;
}

.supplier-empty {
    padding: 20px;
    color: var(--muted);
    text-align: center;
}

.production-supplier-box {
    margin: 12px 0 4px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: var(--surface-2);
}

.production-supplier-title {
    color: var(--text-strong);
    font-size: 12px;
    font-weight: 800;
}

.production-supplier-current {
    margin-top: 5px;
    color: var(--text);
    font-size: 12px;
}

.production-supplier-form {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) auto;
    gap: 8px;
    align-items: end;
    margin-top: 10px;
}

.production-supplier-form label,
.production-upload-supplier {
    display: grid;
    gap: 5px;
}

.production-supplier-form label > span,
.production-upload-supplier > span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
}

.production-supplier-note {
    margin-top: 8px;
    color: var(--muted);
    font-size: 10px;
    line-height: 1.45;
}

.production-upload-supplier {
    margin: 12px 0;
}

@media (max-width: 850px) {
    .supplier-summary-grid,
    .supplier-management-grid {
        grid-template-columns: 1fr;
    }

    .supplier-row,
    .production-supplier-form {
        grid-template-columns: 1fr;
    }
}

.history-supplier {
    margin: 7px 0 10px;
    color: var(--muted);
    font-size: 11px;
}

.history-supplier strong {
    color: var(--text-strong);
}


/* ============================================================
   FOURNISSEURS - AJUSTEMENTS D'ESPACEMENT V1.1
   ============================================================ */

body.rgprod-admin main {
    padding-left: 24px;
    padding-right: 24px;
}

.supplier-summary-grid {
    gap: 14px;
    margin: 18px 0;
}

.supplier-management-grid {
    gap: 16px;
}

.supplier-management-grid .panel,
.supplier-list-panel {
    overflow: hidden;
}

.supplier-management-grid .panel-title,
.supplier-list-panel .panel-title {
    padding: 16px 20px;
}

.supplier-management-grid .panel-body,
.supplier-list-panel .panel-body {
    padding: 18px 20px 20px;
}

.supplier-form {
    gap: 16px;
}

.supplier-form label {
    margin: 0;
}

.supplier-delivery-note {
    margin-top: -2px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-2);
    color: var(--muted);
    font-size: 11px;
    line-height: 1.45;
}

.supplier-delivery-note strong {
    color: var(--text-strong);
}

.supplier-row {
    padding: 16px 0;
}

.supplier-row:first-child {
    padding-top: 2px;
}

.supplier-row:last-child {
    padding-bottom: 2px;
}

.supplier-main {
    min-width: 0;
}

.supplier-name-line {
    margin-bottom: 3px;
}

.supplier-row-actions {
    justify-content: flex-end;
}

@media (max-width: 850px) {
    body.rgprod-admin main {
        padding-left: 14px;
        padding-right: 14px;
    }

    .supplier-management-grid .panel-title,
    .supplier-list-panel .panel-title {
        padding: 14px 16px;
    }

    .supplier-management-grid .panel-body,
    .supplier-list-panel .panel-body {
        padding: 16px;
    }

    .supplier-row-actions {
        justify-content: flex-start;
    }
}


.supplier-delivery-badge {
    display: inline-block;
    margin-top: 7px;
    padding: 4px 8px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface-2);
    color: var(--text-strong);
    font-size: 10px;
    font-weight: 700;
}


/* ============================================================
   COMMANDE - REINITIALISATION PREPARATION FOURNISSEUR
   ============================================================ */

body.rgprod-admin .reset-preparation-box {
    margin-bottom: 14px;
    border-color: var(--waiting-border);
    background: color-mix(in srgb, var(--waiting-bg) 55%, var(--surface));
}

body.rgprod-admin .reset-preparation-button {
    background: var(--waiting-text);
    color: #fff;
    border-color: var(--waiting-text);
    opacity: 1;
}

body.rgprod-admin .reset-preparation-button:hover {
    background: color-mix(in srgb, var(--waiting-text) 88%, #000);
    border-color: color-mix(in srgb, var(--waiting-text) 88%, #000);
    filter: none;
}


/* CORRECTIONS FOURNISSEUR */
.production-correction-action{
display:flex;flex-wrap:wrap;align-items:center;gap:9px;
margin:10px 0 2px;padding:10px 12px;border:1px dashed var(--border);
border-radius:8px;background:var(--surface-2)}
.production-correction-action span{color:var(--muted);font-size:10px}
body.rgprod-admin .btn.correction,
body.rgprod-admin button.btn.correction{
background:#9b2d36;border-color:#9b2d36;color:#fff}
body.rgprod-admin .btn.correction:hover,
body.rgprod-admin button.btn.correction:hover{
background:#84242c;border-color:#84242c;filter:none}
.correction-ready{
padding:12px;border:1px solid color-mix(in srgb,#9b2d36 35%,var(--border));
border-radius:9px;background:color-mix(in srgb,#9b2d36 7%,var(--surface))}
.correction-diff-list{display:grid;gap:6px;margin:10px 0 12px}
.correction-diff{
display:grid;grid-template-columns:minmax(0,1fr) auto minmax(120px,.5fr);
gap:10px;align-items:center;padding:8px 10px;border:1px solid var(--border);
border-radius:7px;background:var(--surface-2);font-size:11px}
.correction-transmission-form{display:grid;gap:9px}
.correction-transmission-form label{display:grid;gap:5px}
.correction-transmission-form label>span{
color:var(--text-strong);font-size:11px;font-weight:700}
.correction-transmission-form textarea{width:100%;resize:vertical}
.correction-badge{
display:inline-flex;align-items:center;margin-left:5px;padding:3px 6px;
border-radius:999px;background:#9b2d36;color:#fff;font-size:9px;
font-weight:800;vertical-align:middle}
@media(max-width:760px){.correction-diff{grid-template-columns:1fr;gap:4px}}


/* TRANSMISSIONS - OUVERTURE */
.transmission-number-link {
    display: inline-block;
    color: var(--text-strong);
    font-weight: 800;
    text-decoration: none;
}

.transmission-number-link:hover {
    text-decoration: underline;
}

body.rgprod-admin .transmission-open-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 64px;
    padding: 6px 10px;
    font-size: 10px;
    white-space: nowrap;
}


/* ============================================================
   TRANSMISSION ADMIN - ALIGNEMENT AVEC LE THEME CENTRAL
   ============================================================ */

body.rgprod-transmission main {
    max-width: 1180px;
    padding: 18px 18px 34px;
}

body.rgprod-transmission .back {
    margin-bottom: 10px;
    font-size: 11px;
}

body.rgprod-transmission h1 {
    margin-bottom: 4px;
    font-size: 22px;
}

body.rgprod-transmission .subtitle {
    margin-bottom: 14px;
    font-size: 11px;
}

body.rgprod-transmission .panel {
    margin-bottom: 12px;
    border: 1px solid var(--border);
    border-radius: 9px;
}

body.rgprod-transmission .panel-title {
    padding: 11px 14px;
    font-size: 13px;
}

body.rgprod-transmission .panel-body {
    padding: 13px 14px;
}

body.rgprod-transmission .summary-grid {
    grid-template-columns:
        repeat(
            auto-fit,
            minmax(145px, 1fr)
        );
    gap: 8px;
}

body.rgprod-transmission .summary-item {
    min-height: 62px;
    padding: 9px 11px;
    border: 1px solid var(--border);
    border-radius: 7px;
}

body.rgprod-transmission .summary-label {
    margin-bottom: 3px;
    font-size: 10px;
}

body.rgprod-transmission .summary-value {
    font-size: 12px;
}

body.rgprod-transmission .file-list {
    gap: 7px;
}

body.rgprod-transmission .file-item {
    padding: 10px 11px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 7px;
}

body.rgprod-transmission .file-name {
    font-size: 12px;
}

body.rgprod-transmission .file-meta {
    margin-top: 3px;
    font-size: 10px;
}

body.rgprod-transmission .download-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 6px;
    margin-right: 5px !important;
    padding: 6px 9px;
    background: var(--accent);
    color: #fff;
    border: 1px solid transparent;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
}

body.rgprod-transmission .download-link:hover {
    background:
        color-mix(
            in srgb,
            var(--accent) 88%,
            #000
        );
    filter: none;
}

body.rgprod-transmission .mail-preview {
    padding: 13px 14px;
}

body.rgprod-transmission .mail-row {
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 9px;
    padding: 5px 0;
    font-size: 11px;
}

body.rgprod-transmission .mail-body-preview {
    margin-top: 11px;
    padding: 13px;
    font-size: 11px;
}

body.rgprod-transmission .form-grid {
    gap: 9px;
    margin-top: 10px;
}

body.rgprod-transmission .confirmation {
    margin-top: 11px;
    padding: 10px 11px;
    background: var(--waiting-bg);
    color: var(--text);
    border: 1px solid var(--waiting-border);
}

body.rgprod-transmission button[type="submit"] {
    margin-top: 11px;
    padding: 8px 13px;
    background: var(--accent);
    color: #fff;
    border: 1px solid transparent;
    border-radius: 6px;
    font-size: 11px;
}

body.rgprod-transmission button[type="submit"]:hover:not(:disabled) {
    background:
        color-mix(
            in srgb,
            var(--accent) 88%,
            #000
        );
    filter: none;
}

body.rgprod-transmission .correction-top-alert {
    margin-bottom: 12px;
}

body.rgprod-admin .transmission-open-button {
    min-width: 62px;
    padding: 5px 9px;
    border-radius: 6px;
    background: var(--accent);
    color: #fff;
    text-decoration: none;
    font-weight: 700;
}

body.rgprod-admin .transmission-open-button:hover {
    background:
        color-mix(
            in srgb,
            var(--accent) 88%,
            #000
        );
    color: #fff;
    text-decoration: none;
    filter: none;
}

@media (max-width: 760px) {

    body.rgprod-transmission main {
        padding: 14px 10px 30px;
    }

    body.rgprod-transmission .summary-grid,
    body.rgprod-transmission .form-grid {
        grid-template-columns: 1fr;
    }

    body.rgprod-transmission .mail-row {
        grid-template-columns: 1fr;
        gap: 2px;
    }
}


/* ============================================================
   NOUVELLE REVISION CORRECTIVE
   ============================================================ */

body.rgprod-correction-revision {
    min-height: 100vh;
}

body.rgprod-correction-revision .correction-header {
    margin: 0;
    padding: 0;
}

body.rgprod-correction-revision .correction-header-inner {
    max-width: 1180px;
    margin: 0 auto;
    padding: 14px 18px 4px;
}

body.rgprod-correction-revision .correction-wrap {
    max-width: 1180px;
    margin: 0 auto;
    padding: 10px 18px 32px;
}

body.rgprod-correction-revision .back {
    display: inline-flex;
    margin-bottom: 7px;
    font-size: 10px;
}

body.rgprod-correction-revision h1 {
    margin: 0 0 3px;
    font-size: 20px;
    line-height: 1.15;
}

body.rgprod-correction-revision .subtitle {
    margin-bottom: 12px;
    color: var(--muted);
    font-size: 11px;
}

body.rgprod-correction-revision .correction-revision-panel {
    margin-top: 10px;
}

body.rgprod-correction-revision .correction-revision-panel .panel-title {
    padding: 10px 13px;
}

body.rgprod-correction-revision .correction-revision-panel .panel-body {
    padding: 12px;
}

body.rgprod-correction-revision .correction-intro {
    margin: 0 0 10px;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-2);
}

body.rgprod-correction-revision .correction-context-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) 90px;
    gap: 8px;
}

body.rgprod-correction-revision .correction-context-item {
    display: grid;
    gap: 2px;
    min-width: 0;
    padding: 7px 9px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: var(--surface);
}

body.rgprod-correction-revision .correction-context-item span {
    color: var(--muted);
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: .03em;
}

body.rgprod-correction-revision .correction-context-item strong {
    overflow: hidden;
    color: var(--text-strong);
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.rgprod-correction-revision .correction-intro-text {
    margin-top: 8px;
    color: var(--muted);
    font-size: 10px;
    line-height: 1.45;
}

body.rgprod-correction-revision .correction-intro-text strong {
    color: var(--error-text);
}

body.rgprod-correction-revision .correction-file-list {
    display: grid;
    gap: 7px;
}

body.rgprod-correction-revision .correction-file {
    display: grid;
    grid-template-columns: 68px minmax(0, 1fr);
    gap: 11px;
    align-items: center;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-2);
}

body.rgprod-correction-revision .correction-file:hover {
    border-color:
        color-mix(
            in srgb,
            var(--accent) 30%,
            var(--border)
        );
}

body.rgprod-correction-revision .correction-thumb {
    width: 64px;
    height: 64px;
    object-fit: contain;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #fff;
}

body.rgprod-correction-revision .correction-name {
    margin-bottom: 3px;
    overflow: hidden;
    color: var(--text-strong);
    font-size: 11px;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.rgprod-correction-revision .correction-keep {
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 9px;
}

body.rgprod-correction-revision .correction-file input[type="file"] {
    width: 100%;
    max-width: 640px;
    min-height: 30px;
    padding: 4px 6px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
    color: var(--text);
    font-size: 10px;
}

body.rgprod-correction-revision .correction-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

body.rgprod-correction-revision .correction-actions button,
body.rgprod-correction-revision .correction-actions .btn {
    min-height: 31px;
    padding: 7px 11px;
    font-size: 10px;
}

body.rgprod-correction-revision .correction-warning {
    color: var(--error-text);
    font-weight: 700;
}

body.rgprod-correction-revision #preview-generation-message {
    margin-top: 10px;
}

@media (max-width: 760px) {

    body.rgprod-correction-revision .correction-header-inner,
    body.rgprod-correction-revision .correction-wrap {
        padding-left: 10px;
        padding-right: 10px;
    }

    body.rgprod-correction-revision .correction-context-grid {
        grid-template-columns: 1fr;
    }

    body.rgprod-correction-revision .correction-file {
        grid-template-columns: 56px minmax(0, 1fr);
    }

    body.rgprod-correction-revision .correction-thumb {
        width: 52px;
        height: 52px;
    }
}

/* ============================================================
   BOUTON "NOUVELLE REVISION CORRECTIVE"
   ============================================================ */

.production-correction-action {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

.production-correction-action .btn.correction {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 8px 13px;

    background: #9b2d36 !important;
    border: 1px solid #9b2d36 !important;
    border-radius: 7px;

    color: #ffffff !important;
    text-decoration: none !important;

    font-size: 11px;
    font-weight: 800;
    line-height: 1;

    opacity: 1 !important;
    filter: none !important;
}

.production-correction-action .btn.correction:hover {
    background: #84242c !important;
    border-color: #84242c !important;
    color: #ffffff !important;
    text-decoration: none !important;
}

.production-correction-action > span {
    color: var(--muted);
    font-size: 10px;
}


/* ============================================================
   5.7.5 — IMAGES PRODUITS PRESTASHOP / SNAPSHOTS LOCAUX
   ============================================================ */

.rgprod-row-identity {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 190px;
}

.rgprod-product-image-sm {
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: #fff;
    object-fit: contain;
}

.rgprod-product-identity {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 8px 0 10px;
}

.rgprod-product-identity h1 {
    margin: 0;
}

.rgprod-product-image-lg {
    width: 116px;
    height: 116px;
    flex: 0 0 116px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
    object-fit: contain;
}

.rgprod-product-image-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5px;
    background: var(--surface-2);
    color: var(--muted);
    text-align: center;
    font-size: 10px;
    line-height: 1.25;
}

@media (max-width: 720px) {
    .rgprod-product-image-lg {
        width: 88px;
        height: 88px;
        flex-basis: 88px;
    }
}

/* ============================================================
   IMPORT PRESTASHOP — ÉTATS DES CANDIDATS
   ============================================================ */

.order-import-row {
    transition: background-color .15s ease, box-shadow .15s ease;
}

.order-import-row--new {
    background: var(--downloaded-bg);
    --order-import-accent: var(--green);
}

.order-import-row--skipped {
    background: var(--waiting-bg);
    --order-import-accent: var(--waiting-border);
}

.order-import-row--imported {
    background: var(--ready-bg);
    --order-import-accent: var(--blue);
    opacity: .9;
}

.order-import-row--failed {
    background: var(--error-bg);
    --order-import-accent: var(--red);
}

.order-import-row:hover {
    background: color-mix(in srgb, var(--order-import-accent) 10%, var(--surface));
}

.order-import-row.is-selected {
    box-shadow:
        inset 5px 0 0 var(--order-import-accent),
        inset 0 0 0 1px color-mix(in srgb, var(--order-import-accent) 30%, transparent);
}

.order-import-row--new.is-selected,
.order-import-row--skipped.is-selected {
    background: color-mix(in srgb, var(--order-import-accent) 16%, var(--surface));
}

.order-import-checkbox {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.order-import-memory {
    margin-top: 3px;
    color: var(--muted);
    font-size: 11px;
}

.order-import-row--skipped .order-import-memory {
    color: var(--waiting-text);
}

.order-import-row--failed .order-import-memory {
    color: var(--error-text);
}
