/**
 * Module Commandes — Styles partagés Delivery + Order
 * public/css/pages/orders.css
 *
 * Règle R77 : Contraste texte/fond vérifié pour tous les cas
 */

/* ========== BADGES STATUTS COMMANDE ========== */

.order-status-badge {
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 0.4rem;
    padding: 0.3em 0.65em;
}

.order-status-pre_order {
    /* V237b3h-58Zx-statuscolors — bleu (Pré-commande). */
    background-color: #0d6efd;
    color: #fff;
}

.order-status-quote {
    /* V237b3h-58Zx-statuscolors — jaune (Devis). Texte foncé : contraste blanc insuffisant (R77). */
    background-color: #ffc107;
    color: #212529;
}

.order-status-confirmed {
    /* V237b3h-58Zx-statuscolors — vert (Validée). La distinction avec Facturée est
       désormais assurée par le gris de Facturée. */
    background-color: #198754;
    color: #fff;
}


.order-status-cancelled {
    background-color: #dc3545;
    color: #fff;
}


.order-status-invoiced {
    /* V237b3h-58Zx-statuscolors — gris (Facturée = clôturée, plus rien à faire). */
    background-color: #6c757d;
    color: #fff;
}

/* ========== BADGE SANS TOURNÉE (R80) ========== */

.order-without-delivery-badge {
    background-color: #fff3cd;
    color: #664d03;
    border: 1px solid #ffecb5;
    font-size: 0.7rem;
    font-weight: 600;
}

/* ========== EN-TÊTE COMMANDE (fond légèrement coloré selon statut) ========== */

.order-header-card {
    border-left: 4px solid #dee2e6;
}

.order-status-bg-pre_order  { border-left-color: #6c757d; }
.order-status-bg-quote      { border-left-color: #0d6efd; }
.order-status-bg-confirmed  { border-left-color: #198754; }
.order-status-bg-cancelled  { border-left-color: #dc3545; }
.order-status-bg-invoiced   { border-left-color: #212529; }

/* ========== BANDEAU PRÉ-COMMANDE PROMINENT (R81) ========== */

.pre-order-banner {
    background-color: #cff4fc;
    border-color: #9eeaf9;
    color: #055160;
    border-radius: 0.5rem;
    padding: 1.25rem 1.5rem;
}

.pre-order-banner .fw-bold {
    letter-spacing: 0.03em;
}

/* ========== TABLEAUX LIGNES DE COMMANDE ========== */

#table-order-lines td {
    vertical-align: middle;
}

#table-order-lines input.form-control-sm {
    font-size: 0.82rem;
}

/* ========== TOURNÉES DE LIVRAISON ========== */

#table-deliveries td,
#table-delivery-orders td {
    vertical-align: middle;
}

/* ========== ALERTE SANS TOURNÉE (index) ========== */

#alert-without-delivery {
    border-radius: 0.5rem;
}

/* ========== FORMULAIRES ORDRE DE PASSAGE ========== */

.order-field[data-field="deliveryOrder"] {
    text-align: center;
    min-width: 60px;
    max-width: 80px;
}

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

@media (max-width: 767.98px) {
    .order-header-card .col-auto .dropdown {
        width: 100%;
    }

    .pre-order-banner {
        flex-direction: column;
        gap: 1rem;
    }

    .pre-order-banner .d-flex.gap-2 {
        flex-wrap: wrap;
    }
}

/* ========== WIZARD CRÉATION COMMANDE (R79) ========== */

.wizard-steps {
    gap: 0;
    align-items: flex-end;
    padding-bottom: 0;
}

.wizard-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: default;
    padding-bottom: 0.75rem;
    border-bottom: 3px solid transparent;
    transition: border-color 0.2s;
    min-width: 100px;
}

.wizard-step.active {
    border-bottom-color: #0d6efd;
}

.wizard-step.completed {
    border-bottom-color: #198754;
}

.wizard-step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #dee2e6;
    color: #6c757d;
    font-weight: 700;
    font-size: .8rem;
    margin-bottom: .25rem;
    transition: background 0.2s, color 0.2s;
}

.wizard-step.active  .wizard-step-num  { background: #0d6efd; color: #fff; }
.wizard-step.completed .wizard-step-num { background: #198754; color: #fff; }

.wizard-step-label {
    font-size: .72rem;
    color: #6c757d;
    font-weight: 500;
    text-align: center;
}

.wizard-step.active   .wizard-step-label { color: #0d6efd; font-weight: 600; }
.wizard-step.completed .wizard-step-label { color: #198754; }

.wizard-step-sep {
    flex: 1;
    height: 2px;
    background: #dee2e6;
    margin-bottom: 1.15rem;
    align-self: center;
}

.wizard-pane {
    display: none;
}

.wizard-pane.active {
    display: block;
}

.btn-wizard-type,
.btn-wizard-transport {
    transition: all 0.15s;
}

.btn-wizard-type.active {
    background-color: #0d6efd;
    color: #fff;
    border-color: #0d6efd;
}

/* Tableau onglet commandes dans Directory */
#table-dir-orders td {
    vertical-align: middle;
}

/* Livraison post-facturation */
.order-status-delivered {
    background-color: #0dcaf0;
    color: #212529;
}
.order-status-bg-delivered  { border-left-color: #0dcaf0; }

/* Badge alerte facturation avant livraison sur fiche client */
.badge-invoice-before-delivery {
    background-color: #fd7e14;
    color: #fff;
    font-size: 0.75rem;
}

/* ========== JUMBOTRON S3 (V178z145a) ========== */

.order-jumbotron {
    border-left: 5px solid #dee2e6;
}

.order-jumbotron.order-status-bg-quote      { border-left-color: #0d6efd; }
.order-jumbotron.order-status-bg-confirmed  { border-left-color: #198754; }
.order-jumbotron.order-status-bg-pre_order  { border-left-color: #6c757d; }
.order-jumbotron.order-status-bg-cancelled  { border-left-color: #dc3545; }
.order-jumbotron.order-status-bg-invoiced   { border-left-color: #212529; }
.order-jumbotron.order-status-bg-delivered  { border-left-color: #0dcaf0; }

.order-jumbotron-title {
    font-size: 1.35rem;
    font-weight: 700;
}

.order-jumbotron-client {
    font-size: 1rem;
    font-weight: 700;
    color: #333;
}

/* Box blanche intérieure style S3 */
.order-jumbotron-box {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 12px 16px;
}

/* Tables internes style S3 */
.order-jt {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}

.order-jt-border td,
.order-jt-border th {
    padding: 4px 8px;
    border: 1px solid #dee2e6;
    vertical-align: middle;
}

.order-jt-label {
    width: 18%;
}

/* Input compact style S3 */
.order-jt-input {
    border: 1px solid #86b7fe;
    border-radius: 5px;
    padding: 3px 7px;
    background: #f0f7ff;
    font-size: 0.82rem;
}

.order-jt-input:focus {
    outline: none;
    background: #fff;
    border-color: #0d6efd;
}

.order-jt-input[readonly] {
    background: #f8f9fa;
    border-color: #dee2e6;
    color: #6c757d;
}

/* Table totaux jaune (style S3) */
.order-jt-totals {
    background: #fff3cd;
}

.order-jt-totals td,
.order-jt-totals th {
    padding: 5px 10px;
    border: 1px solid #ffc107;
    vertical-align: middle;
}

.order-jt-totals th {
    background: #ffe69c;
    font-weight: 600;
    color: #333;
}

.order-jt-total-final {
    color: #0d6efd;
    font-weight: 700;
    font-size: 1rem;
}

/* Notice export (HT seul) */
.order-jt-export-notice {
    background: #f3e5f5;
}

.order-jt-export-notice td {
    border-color: #ce93d8;
    color: #4a148c;
}

/* Badge fiscal */
.order-fiscal-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border-radius: 6px;
    padding: 3px 10px;
    font-size: 0.75rem;
    font-weight: 500;
    margin-top: 2px;
}

.order-fiscal-same {
    background: #e8f5e9;
    border: 1px solid #a5d6a7;
    color: #2e7d32;
}

.order-fiscal-diff {
    background: #fce4ec;
    border: 1px solid #f48fb1;
    color: #c62828;
}

/* Hint filtre site sur entité facturation */
.order-jt-site-hint {
    font-size: 0.72rem;
    color: #6c757d;
    margin-top: 3px;
}

/* Lot/Série inline dans jumbotron */
.order-lot-inline {
    background: #f0fff4;
    border: 1px solid #b7e4c7;
    border-radius: 6px;
    padding: 8px 14px;
    font-size: 0.82rem;
}

.order-lot-inline-empty {
    background: #fff8e1;
    border-color: #ffe082;
    color: #795548;
}

.order-lot-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: #198754;
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* Colonnes TVA/TTC dans table lignes */
.order-col-tva,
.order-col-ttc {
    font-size: 0.82rem;
}


/* ========== SECTION CONDITIONNEMENT (V178z145b) ========== */

.order-pkg-section {
    border: none;
    border-radius: 0;
    overflow: hidden;
}

.order-pkg-header {
    background: #3d5a80;
    color: #fff;
    padding: 5px 12px;
    font-size: 0.78rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.order-pkg-sync-zone {
    display: flex;
    align-items: center;
    gap: 5px;
}

.order-pkg-sync-label {
    font-size: 0.74rem;
    font-weight: 600;
}

.order-pkg-sync-on  { color: #a5d6a7; }
.order-pkg-sync-off { color: #ffcc80; }

.order-pkg-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 12px;
    font-size: 0.82rem;
    border-bottom: 1px solid #f0f0f0;
    flex-wrap: wrap;
}

.order-pkg-label {
    min-width: 150px;
    font-weight: 600;
}

.order-pkg-badge {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 4px;
    font-size: 0.72rem;
    white-space: nowrap;
}

.order-pkg-free {
    background: #e8f5e9;
    border: 1px solid #a5d6a7;
    color: #2e7d32;
}

.order-pkg-billed {
    background: #fff3cd;
    border: 1px solid #ffc107;
    color: #e65100;
}

/* Valeur auto calculée */
.order-pkg-count-auto {
    background: #e3f2fd;
    border: 1px dashed #90caf9;
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 0.82rem;
    color: #1565c0;
    min-width: 36px;
    text-align: center;
    display: inline-block;
}

/* Input valeur réelle */
.order-pkg-count-input {
    width: 70px;
    border: 1px solid #86b7fe;
    border-radius: 4px;
    padding: 2px 6px;
    background: #f0f7ff;
    text-align: center;
    font-size: 0.82rem;
}

/* Ligne récap totaux facturé/gratuit */
.order-pkg-total-row {
    background: #f8f9fa;
    border-top: 1px solid #dee2e6;
    padding: 5px 12px;
    font-size: 0.78rem;
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}


/* ========== PRO-FORMA / SNAPSHOTS (V178z145c) ========== */

.badge-snapshot-latest {
    background: #198754;
    color: #fff;
    font-size: 0.72rem;
    padding: 2px 8px;
    border-radius: 10px;
}

.badge-snapshot-old {
    background: #6c757d;
    color: #fff;
    font-size: 0.72rem;
    padding: 2px 8px;
    border-radius: 10px;
}

.btn-proforma-create {
    background: #3d5a80;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 7px 18px;
    font-size: 0.85rem;
    cursor: pointer;
    white-space: nowrap;
}

.btn-proforma-create:hover {
    background: #2c4a6e;
    color: #fff;
}

.btn-pf-create-confirm {
    background: #3d5a80;
    color: #fff;
}

.btn-pf-create-confirm:hover {
    background: #2c4a6e;
    color: #fff;
}


/* ========== PRO-FORMA / SNAPSHOTS (V178z145c) ========== */

/* Bouton créer pro-forma (header bleu foncé) */
.btn-proforma-create {
    background: #3d5a80;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 7px 18px;
    font-size: 0.85rem;
    cursor: pointer;
    white-space: nowrap;
}
.btn-proforma-create:hover { background: #2c4a6e; color: #fff; }

/* Bouton confirmer création (dans modal) */
.btn-pf-create-confirm {
    background: #3d5a80;
    color: #fff;
    border: none;
}
.btn-pf-create-confirm:hover { background: #2c4a6e; color: #fff; }

/* Badges tableau pro-forma */
.badge-snapshot-latest {
    background: #198754;
    color: #fff;
    font-size: 0.72rem;
    padding: 2px 8px;
    border-radius: 10px;
    display: inline-block;
}
.badge-snapshot-old {
    background: #6c757d;
    color: #fff;
    font-size: 0.72rem;
    padding: 2px 8px;
    border-radius: 10px;
    display: inline-block;
}

/* En-tête du tableau pro-forma */
#table-proforma thead th {
    background: #3d5a80;
    color: #fff;
    font-size: 0.75rem;
    vertical-align: middle;
}


/* ========== BREAKDOWN PARCS (V178z145d) ========== */

/* Bouton expand › */
.btn-breakdown {
    background: #e8eaf6;
    border: 1px solid #5c6bc0;
    border-radius: 4px;
    padding: 2px 7px;
    font-size: 0.75rem;
    color: #283593;
    cursor: pointer;
    line-height: 1.4;
    transition: background 0.15s, border-color 0.15s;
    font-weight: 600;
}
.btn-breakdown:hover { background: #c5cae9; border-color: #283593; }

/* Ligne breakdown */
.line-breakdown-row td {
    background: #f0f4ff;
    padding: 0 !important;
    border-top: none !important;
}

/* Wrapper intérieur */
.order-breakdown-inner {
    margin: 4px 8px 6px;
    border: 1px solid #c5cae9;
    border-radius: 6px;
    overflow: hidden;
    font-size: 0.8rem;
}

.order-breakdown-inner-wrap {
    background: #fff;
}

/* En-tête breakdown */
.order-breakdown-header {
    background: #3d5a80;
    color: #fff;
    padding: 5px 12px;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Tableau parcs */
.order-breakdown-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.79rem;
}

.order-breakdown-table td,
.order-breakdown-table th {
    padding: 4px 10px;
    border: 1px solid #c5cae9;
    vertical-align: middle;
}

.order-breakdown-table th {
    background: #e8eaf6;
    font-size: 0.72rem;
    text-transform: uppercase;
    color: #3949ab;
    font-weight: 600;
}

/* Barre de proportion */
.order-breakdown-bar {
    height: 5px;
    background: #3d5a80;
    border-radius: 3px;
    display: inline-block;
    vertical-align: middle;
    margin-left: 4px;
    min-width: 2px;
}

/* Input qté réelle */
.order-breakdown-input {
    width: 72px;
    border: 1px solid #9fa8da;
    border-radius: 4px;
    padding: 2px 5px;
    text-align: center;
    font-size: 0.79rem;
    background: #fff;
}
.order-breakdown-input:focus {
    outline: none;
    border-color: #3d5a80;
    background: #f0f4ff;
}

/* Ligne total */
.order-breakdown-total {
    background: #e8eaf6;
    font-weight: 700;
}

/* Notes et états */
.order-breakdown-note {
    background: #fffde7;
    border-top: 1px solid #ffe082;
    padding: 4px 12px;
    font-size: 0.75rem;
    color: #f57f17;
}

.order-breakdown-empty,
.order-breakdown-loading {
    padding: 10px 14px;
    font-size: 0.8rem;
    color: #6c757d;
    background: #f8f9fa;
}

.order-breakdown-error {
    padding: 8px 12px;
    font-size: 0.8rem;
    color: #dc3545;
    background: #fdecea;
}


/* ========== ONGLET DOCUMENTS STYLE S3 (V178z145e) ========== */

.order-doc-dispo-zone {
    background: #d4edda;
    border-radius: 6px;
    padding: 8px 14px;
    font-size: 0.85rem;
    text-align: center;
}

.order-doc-table {
    width: 100%;
    border-collapse: collapse;
}

.order-doc-table td,
.order-doc-table th {
    border: 1px solid #dee2e6;
    padding: 8px 10px;
    vertical-align: top;
    text-align: center;
}

.order-doc-table th {
    background: #f8f9fa;
    text-align: left;
    font-weight: 700;
    white-space: nowrap;
    width: 110px;
    vertical-align: middle;
}

.order-doc-btn-ok {
    background: #198754;
    color: #fff;
    border: none;
    border-radius: 20px;
    padding: 5px 16px;
    font-size: 0.82rem;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}

.order-doc-btn-ok:hover {
    background: #157347;
    color: #fff;
    text-decoration: none;
}

.order-doc-btn-off {
    background: #6c757d;
    color: #fff;
    border: none;
    border-radius: 20px;
    padding: 5px 16px;
    font-size: 0.82rem;
    cursor: not-allowed;
    opacity: 0.6;
}

.order-doc-meta {
    font-size: 0.72rem;
    color: #666;
    display: block;
    margin-top: 4px;
    line-height: 1.4;
}

.order-doc-status-label {
    font-size: 0.72rem;
    color: #dc3545;
    font-weight: 600;
    display: block;
    margin-bottom: 3px;
}

.order-doc-textarea {
    font-size: 0.78rem;
    resize: vertical;
    min-height: 130px;
}


/* ========== ONGLET LIVRAISON (V178z146) ========== */

.delivery-select-row:hover td {
    background: #e8f4ff;
}

.delivery-row-selected td {
    background: #d1ecf1 !important;
    font-weight: 600;
}


/* ========== SÉLECTION TOURNÉE (V178z146) ========== */

.delivery-select-row:hover td {
    background: #e8f5e9;
}

.delivery-row-selected td {
    background: #d4edda !important;
    font-weight: 600;
}

.delivery-row-selected td:first-child::before {
    content: '✓ ';
    color: #198754;
}


/* ── Breakdown / Ventilation par parc (V178z149) ── */
.input-over-forecast {
    background-color: rgba(220, 53, 69, .12) !important;
    border-color: #dc3545 !important;
}

.line-forecast-hint {
    font-size: 0.72rem;
    margin-top: 2px;
    opacity: .75;
    line-height: 1.2;
}

.order-breakdown-input.input-over-forecast {
    background-color: rgba(220, 53, 69, .12) !important;
    border-color: #dc3545 !important;
}

/* ========== SECTION SERVICES (immatériels) ========== */

.svc-section {
    border: 2px dashed #d0bcff;
    border-radius: 10px;
    background: #f3f0ff;
    overflow: hidden;
}

.svc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 14px;
    background: #e9e2ff;
    border-bottom: 1px solid #d0bcff;
}

.svc-title {
    font-weight: 700;
    color: #6f42c1;
    font-size: .87rem;
    display: flex;
    align-items: center;
    gap: 7px;
}

.svc-table {
    border-collapse: collapse;
}

.svc-table th {
    background: #ece8ff;
    color: #6f42c1;
    font-size: .73rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    padding: 5px 10px;
    border-bottom: 1px solid #d0bcff;
}

.svc-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #ece8ff;
    vertical-align: middle;
    background: #fff;
}

.svc-table tr:last-child td {
    border-bottom: none;
}

.svc-table tr:hover td {
    background: #faf8ff;
}

.badge-svc {
    background: #f3f0ff;
    color: #6f42c1;
    border: 1px solid #d0bcff;
    font-size: .7rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 4px;
}

.mode-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 20px;
    font-size: .72rem;
    font-weight: 600;
    white-space: nowrap;
}

.mode-all    { background: #d1e7dd; color: #0a3622; }
.mode-sel    { background: #fff3cd; color: #664d03; }
.mode-manual { background: #e9ecef; color: #495057; }

.svc-footer {
    background: #e9e2ff;
    border-top: 1px solid #d0bcff;
    padding: 6px 14px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
}

.svc-footer-label { color: #6f42c1; font-size: .8rem; }
.svc-footer-total { color: #6f42c1; font-weight: 700; font-size: .95rem; }

/* Ligne tableau marquée comme incluse dans un service "selected" */
tr.svc-line-marked td:first-child { border-left: 3px solid #6f42c1; }
tr.svc-line-marked { background: #faf5ff !important; }

/* Toggle inclusion/exclusion par ligne */
.line-svc-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 4px;
    cursor: pointer;
    border: 2px solid #adb5bd;
    background: #fff;
    transition: all .12s;
}

.line-svc-toggle.on {
    background: #6f42c1;
    border-color: #6f42c1;
    color: #fff;
}

/* ========================================================================
   V237b3dn — Chips filtre par statut sur l'onglet "Commandes" de la fiche client
   (templates/intranet/directory/show.html.twig)
   - État actif : couleur du statut (réutilise .order-status-XXX existant)
   - État inactif : grisé / opacité réduite
   - Le filtre toggle l'attribut `.active` au clic (cf. directory-show.js)
   ======================================================================== */
.dir-orders-status-chip {
    border: 1px solid transparent;
    opacity: 0.4;
    filter: grayscale(0.6);
    cursor: pointer;
    transition: opacity .15s, filter .15s, transform .1s;
}

.dir-orders-status-chip.active {
    opacity: 1;
    filter: none;
}

.dir-orders-status-chip:hover {
    transform: translateY(-1px);
}

.dir-orders-status-chip:focus {
    outline: 2px solid rgba(13, 110, 253, 0.25);
    outline-offset: 2px;
}


/* ============================================================
   V237b3h-58Zx-ai (16/05/2026) — Refonte cosmétique jumbotron
   Niveau A : padding plus aéré, border-radius généreux, ombre
   très subtile, typographie allégée. Aucun changement de
   comportement, juste de la peau. Tous les sélecteurs ciblent
   uniquement .order-jumbotron* (audit : seul show.html.twig
   les utilise). Pour revert : retirer cette section complète.
   ============================================================ */

.order-jumbotron {
    border-radius: 10px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    transition: box-shadow 0.15s ease;
}

.order-jumbotron > .card-body {
    padding: 1.1rem 1.25rem;
}

.order-jumbotron-title {
    font-weight: 600;
    letter-spacing: -0.2px;
    color: #212529;
}

.order-jumbotron-client {
    font-weight: 500;
    color: #495057;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
}

.order-jumbotron-box {
    border-radius: 8px;
    padding: 14px 18px;
    border-color: #e9ecef;
}


/* ============================================================
   V237b3h-58Zx-aj (16/05/2026) — Refonte complète jumbotron
   Proposition A "bandeau coloré". Classes .order-jt-v2-*
   uniquement appliquées si le wrapper a la classe .order-jt-v2
   (ajoutée par V58Zx-aj). Couleurs par statut via
   .order-jt-v2-status-{statut} sur le wrapper.

   Palette : rouge annulé, jaune devis, bleu validé, vert facturé,
   gris pre_order, cyan delivered.

   Aucune classe Bootstrap modifiée. R8e additif.
   ============================================================ */

/* === Wrapper jumbotron V58Zx-aj === */
.order-jt-v2 {
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
    border: 1px solid #e5e7eb;
    border-left: 6px solid #9ca3af;
    overflow: hidden;
}

/* Bordure gauche + fond très léger selon statut */
.order-jt-v2.order-jt-v2-status-pre_order  { border-left-color: #7c3aed; background: linear-gradient(to right, #f5f3ff 0%, white 25%); } /* V58Zx-al : violet pour pre_order */
.order-jt-v2.order-jt-v2-status-quote      { border-left-color: #f59e0b; background: linear-gradient(to right, #fffbeb 0%, white 25%); }
.order-jt-v2.order-jt-v2-status-confirmed  { border-left-color: #0d6efd; background: linear-gradient(to right, #eff6ff 0%, white 25%); }
.order-jt-v2.order-jt-v2-status-shipped    { border-left-color: #0d6efd; background: linear-gradient(to right, #eff6ff 0%, white 25%); }
.order-jt-v2.order-jt-v2-status-invoiced   { border-left-color: #16a34a; background: linear-gradient(to right, #f0fdf4 0%, white 25%); }
.order-jt-v2.order-jt-v2-status-delivered  { border-left-color: #0dcaf0; background: linear-gradient(to right, #ecfeff 0%, white 25%); }
.order-jt-v2.order-jt-v2-status-cancelled  { border-left-color: #dc3545; background: linear-gradient(to right, #fef2f2 0%, white 25%); }

/* === Header (titre + actions) === */
.order-jt-v2-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 12px;
    padding: 14px 18px 10px;
    background: rgba(255, 255, 255, 0.5);
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.order-jt-v2-identity { flex: 1; min-width: 280px; }

.order-jt-v2-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}

.order-jt-v2-type-icon {
    font-size: 1.1rem;
    color: #6b7280;
}

.order-jt-v2-title {
    font-size: 1.35rem;
    font-weight: 600;
    color: #1f2937;
    letter-spacing: -0.3px;
    margin: 0;
}

.order-jt-v2-date {
    font-size: 0.85rem;
    color: #6b7280;
    font-weight: 400;
}

.order-jt-v2-subjects {
    font-size: 0.85rem;
    color: #4b5563;
    margin-left: 4px;
}
.order-jt-v2-subjects strong { color: #1f2937; }

.order-jt-v2-client-row {
    font-size: 0.95rem;
    font-weight: 500;
    color: #374151;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
}

.order-jt-v2-actions {
    display: flex;
    gap: 8px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.order-jt-v2-action-label {
    font-size: 10.5px;
    color: #6b7280;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

/* === Pills === */
.order-jt-v2-pill {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.3px;
    line-height: 1.7;
    white-space: nowrap;
}

.order-jt-v2-pill-type {
    background: #f3f4f6;
    color: #374151;
    text-transform: uppercase;
}

.order-jt-v2-pill-status {
    text-transform: uppercase;
}
.order-jt-v2-pill-status-pre_order  { background: #ede9fe; color: #5b21b6; } /* V58Zx-al : violet */
.order-jt-v2-pill-status-quote      { background: #fef3c7; color: #92400e; }
.order-jt-v2-pill-status-confirmed  { background: #dbeafe; color: #1e40af; }
.order-jt-v2-pill-status-shipped    { background: #dbeafe; color: #1e40af; }
.order-jt-v2-pill-status-invoiced   { background: #dcfce7; color: #166534; }
.order-jt-v2-pill-status-delivered  { background: #cffafe; color: #155e75; }
.order-jt-v2-pill-status-cancelled  { background: #fee2e2; color: #991b1b; }

/* Pills fiscaux (conservent les classes existantes mais ajustent dans le contexte V2) */
.order-jt-v2 .order-fiscal-same,
.order-jt-v2 .order-fiscal-diff {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 500;
    line-height: 1.7;
}

/* === Body === */
.order-jt-v2-body {
    padding: 12px 18px;
}

/* === Grid 2 colonnes (Lot/Transport, Commentaires) === */
.order-jt-v2-grid-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
@media (max-width: 768px) {
    .order-jt-v2-grid-2col { grid-template-columns: 1fr; }
}

/* === Info card === */
.order-jt-v2-info-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 10px 14px;
}

.order-jt-v2-info-card-flush {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}

.order-jt-v2-info-card-internal {
    background: #fefce8;
    border-color: #fde68a;
}

.order-jt-v2-info-label {
    font-size: 10.5px;
    color: #6b7280;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 4px;
}

.order-jt-v2-info-value {
    font-size: 13px;
    color: #1f2937;
}

/* === Section repliable === */
.order-jt-v2-details {
    margin-top: 8px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
}

.order-jt-v2-details-summary {
    padding: 8px 14px;
    font-size: 12px;
    color: #6b7280;
    cursor: pointer;
    user-select: none;
    list-style: none;
}
.order-jt-v2-details-summary::-webkit-details-marker { display: none; }
.order-jt-v2-details[open] .order-jt-v2-details-summary .fa-chevron-right {
    transform: rotate(90deg);
}
.order-jt-v2-details-summary .fa-chevron-right {
    transition: transform 0.15s ease;
    font-size: 10px;
}
.order-jt-v2-details-body {
    padding: 10px 14px;
    border-top: 1px solid #e5e7eb;
}

/* === Force la couleur de la bordure status pour l'ancienne classe co-applied === */
/* (les anciennes règles .order-jumbotron.order-status-bg-* continuent de fonctionner mais
    la nouvelle bordure prime via .order-jt-v2.order-jt-v2-status-*) */


/* ============================================================
   V237b3h-58Zx-ap (16/05/2026) — Mise en avant tournées
   compatibles avec le transport_type de la commande.
   La ligne reçoit un fond très subtil verdâtre + bordure
   gauche verte. Compatible avec table-striped existant
   (s'ajoute proprement sans override agressif).
   ============================================================ */
.delivery-row-matching-transport td {
    background-color: rgba(25, 135, 84, 0.06) !important;
}
.delivery-row-matching-transport td:first-child {
    border-left: 3px solid #198754;
    padding-left: 8px;
}
.delivery-row-matching-transport:hover td {
    background-color: rgba(25, 135, 84, 0.12) !important;
}
/* Quand sélectionnée ET matching : la sélection prime visuellement */
.delivery-row-matching-transport.delivery-row-selected td {
    background-color: #d4edda !important;
    border-left-color: #198754;
}

/* bp1072 — prix unitaire absent/0 : mise en evidence (retiree en temps reel des que > 0) */
.form-control.input-price-zero { background-color: #ffe0b3; }

/* bp1641 (demande MV) — JALONS DE SUIVI d'une tournée (index des livraisons +
   bandeau de la fiche) : où en est le déroulement, d'un coup d'œil.
   ok = fait (vert) · warn = action attendue (ambre) · off = pas encore (gris). */
.suivi-jalons { margin-top: 3px; display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
/* bp1644 (retour MV : « il me faut des boutons ») — les jalons sont de vrais
   boutons : fond, bordure, relief léger ; les liens (verts, oranges) réagissent
   au survol. Le gris est un état, pas une action. */
.jalon { font-size: 12px; font-weight: 700; padding: 4px 11px; border-radius: 6px;
         border: 1px solid transparent; white-space: nowrap; display: inline-block;
         line-height: 1.25; box-shadow: 0 1px 1px rgba(20, 35, 50, .06); }
.jalon-ok   { background: #d7f2df; color: #1e7e34; border-color: #b5e2c3; }
.jalon-warn { background: #fdeacc; color: #b45309; border-color: #f2d095; }
.jalon-off  { background: #eef1f4; color: #8a97a5; border-color: #dde3e9; box-shadow: none; }

/* bp1642 (demande MV) — chronologie en SOUS-LIGNE (index, child row DataTables)
   et dans le bandeau de la fiche : jalons à la suite, séparés d'un chevron ;
   verts et oranges sont des LIENS vers l'écran concerné. */
tr.jalon-subrow > td { background: #fbfcfe; border-top: 0; padding: 3px 12px 7px; }
.suivi-jalons-ligne { justify-content: flex-start; align-items: center; }
a.jalon { text-decoration: none; }
a.jalon:hover { filter: brightness(.92); text-decoration: underline; }
.jalon-sep { color: #b6c0ca; font-weight: 700; padding: 0 2px; }

/* bp1645 (demande MV) — la ligne des boutons est SOUDÉE à sa livraison : le
   trait de tableau entre les deux disparaît (Bootstrap pose le trait en
   border-bottom sur les td de la ligne principale). */
tr.has-jalon-subrow > td { border-bottom-width: 0; }
