/* ============================================================
   Commande list — mobile toolbar + ticket cards
   Used by CommandeCardsForAdmins.vue / CommandeCardsForClient.vue
   ============================================================ */

/* ---------- Mobile bulk toolbar (parent) ---------- */
.cmd-cards-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    margin-bottom: 12px;
    background: #fff;
    border: 1px solid #e7eaf1;
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(20, 30, 60, 0.04),
        0 6px 18px rgba(20, 30, 60, 0.05);
}
.cmd-cards-toolbar .btn-group > .dropdown-toggle {
    border-radius: 9px;
    font-weight: 600;
    letter-spacing: 0.01em;
}
.cmd-cards-toolbar .cmd-selectall {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.86rem;
    font-weight: 700;
    color: #1b2138;
    font-variant-numeric: tabular-nums;
    margin: 0;
}
.cmd-cards-toolbar .cmd-selectall input {
    width: 18px;
    height: 18px;
    accent-color: #232343;
}

/* ============================================================
   Tickets (mobile) — CommandeCardsForClient / ForAdmins
   A "delivery ticket": colored status rail, hero amount,
   perforated split, meta grid, date stub, one row of actions.
   ============================================================ */
.cmdc-ticket {
    --cmdc-ink: #1b2138;
    --cmdc-muted: #6b7488;
    --cmdc-line: #e7eaf1;
    --cmdc-canvas: #f7f9fc;
    position: relative;
    display: flex;
    margin-bottom: 12px;
    background: #fff;
    border: 1px solid var(--cmdc-line);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(20, 30, 60, 0.04),
        0 8px 22px rgba(20, 30, 60, 0.05);
    transition: box-shadow 0.18s ease, border-color 0.18s ease;
}
.cmdc-ticket.is-selected {
    border-color: #232343;
    box-shadow: 0 0 0 2px rgba(35, 35, 67, 0.12),
        0 8px 22px rgba(20, 30, 60, 0.08);
}
/* Status rail: colored by the status badge class */
.cmdc-ticket__rail {
    flex: none;
    width: 6px;
    align-self: stretch;
}
.cmdc-ticket__body {
    flex: 1 1 auto;
    min-width: 0;
    padding: 10px 12px 12px;
}

/* ---------- Head ---------- */
.cmdc-head {
    display: flex;
    align-items: center;
    gap: 8px;
}
.cmdc-check {
    margin: 0;
    display: inline-flex;
}
.cmdc-check input {
    width: 17px;
    height: 17px;
    accent-color: #232343;
}
.cmdc-ref {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    font-weight: 800;
    font-size: 0.75rem;
    letter-spacing: 0.02em;
    color: var(--cmdc-ink);
    cursor: pointer;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.cmdc-ref.is-updated {
    color: brown;
}
.cmdc-ref i {
    font-size: 0.72rem;
    color: #9aa3b5;
}
.cmdc-ref:hover i {
    color: #007bff;
}
.cmdc-flags {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #e5484d;
    font-size: 0.78rem;
}
.cmdc-flags .fa-user,
.cmdc-flags .fa-truck {
    color: #007bff;
}
/* Used in front of the product line instead of the header: no auto-margin
   push, and sized like the other meta-row icons rather than the bigger
   header flags. */
.cmdc-flags--inline {
    margin-left: 0;
    flex: none;
    gap: 6px;
}
.cmdc-flags--inline i {
    font-size: 0.72rem;
}

/* ---------- Montant: pill at the end of the reference line ----------
   Background comes from the status badge class, like the chip below. */
.cmdc-amount {
    margin-left: auto;
    flex: none;
    padding: 3px 10px;
    border-radius: 999px;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 800;
    line-height: 1.5;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
/* Status pills: compact, on their own line */
.cmdc-chip {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    max-width: 100%;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 0.66rem;
    font-weight: 700;
    line-height: 1.5;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cmdc-chip i {
    font-size: 0.62rem;
}
.cmdc-chips {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    margin-top: 5px;
}
/* Neutral pill for secondary info */
.cmdc-chip.is-ghost {
    background: var(--cmdc-canvas);
    border: 1px solid var(--cmdc-line);
    color: #6b7488;
    font-weight: 600;
}

/* ---------- Perforation ---------- */
.cmdc-perf {
    position: relative;
    height: 1px;
    margin: 11px -12px 10px;
    border-top: 1px dashed #dfe4ee;
}
.cmdc-perf::before,
.cmdc-perf::after {
    content: "";
    position: absolute;
    top: -6px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #f4f6f9;
    box-shadow: inset 0 0 0 1px var(--cmdc-line);
}
.cmdc-perf::before {
    left: -6px;
}
.cmdc-perf::after {
    right: -6px;
}

/* ---------- Meta grid ---------- */
.cmdc-meta {
    display: grid;
    /* two columns only when both fit; otherwise each value gets the full width */
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 6px 12px;
    font-size: 0.78rem;
    color: var(--cmdc-muted);
}
.cmdc-meta__cell {
    display: flex;
    align-items: baseline;
    gap: 6px;
    min-width: 0;
}
/* Long values (produit, adresse) take the whole row */
.cmdc-meta__cell.is-wide {
    grid-column: 1 / -1;
}
.cmdc-meta__cell > i {
    flex: none;
    width: 13px;
    text-align: center;
    color: #9aa3b5;
    font-size: 0.72rem;
}
/* One line per value: cut with an ellipsis rather than wrapping */
.cmdc-meta__cell > span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.cmdc-meta__cell b {
    color: var(--cmdc-ink);
}
.cmdc-meta__cell small {
    color: #9aa3b5;
}
/* Phone sits in the grid like any other value: tap to call,
   small magnifier for the lookup, triangle when already known. */
.cmdc-tel {
    color: var(--cmdc-ink);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.cmdc-tel:hover,
.cmdc-tel:focus {
    color: #007bff;
    text-decoration: none;
}
.cmdc-tel__check {
    margin-left: 5px;
    padding: 0;
    border: 0;
    background: none;
    color: #9aa3b5;
    font-size: 0.7rem;
    line-height: 1;
    cursor: pointer;
}
.cmdc-tel__check:hover {
    color: #232343;
}
.cmdc-tel__check.is-alert,
.cmdc-tel__flag {
    color: #e5484d;
    margin-left: 5px;
    font-size: 0.7rem;
}

/* ---------- Notes ---------- */
.cmdc-note {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    margin: 8px 0 0;
    padding: 6px 8px;
    border-radius: 8px;
    background: var(--cmdc-canvas);
    border-left: 3px solid #cfd6e4;
    font-size: 0.76rem;
    color: #55607a;
}
.cmdc-note.is-warning {
    background: #fff8ec;
    border-left-color: #f0a336;
    color: #8a5a12;
}
.cmdc-note.is-danger {
    background: #fdf3f3;
    border-left-color: #e5484d;
    color: #a12a2e;
}
/* ---------- Ticket stub: dates ---------- */
.cmdc-stub {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 10px;
    font-size: 0.68rem;
    color: #9aa3b5;
    font-variant-numeric: tabular-nums;
}
.cmdc-stub span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.cmdc-stub i {
    font-size: 0.64rem;
    color: #b6bdcb;
}

/* ---------- Footer: every action on a single row ---------- */
.cmdc-foot {
    display: flex;
    align-items: stretch;
    flex-wrap: nowrap;
    gap: 5px;
    margin-top: 8px;
}
/* Action components wrap their trigger (+ modal) in a <span>:
   let the trigger itself be the flex item. */
.cmdc-foot > span {
    display: contents;
}
.cmdc-btn,
.cmdc-foot .table-action {
    flex: 1 1 0;
    min-width: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 32px;
    padding: 0;
    border: 1px solid var(--cmdc-line);
    border-radius: 8px;
    background: #fff;
    color: #55607a;
    font-size: 0.82rem;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.cmdc-btn:hover,
.cmdc-foot .table-action:hover {
    background: #232343;
    border-color: #232343;
    color: #fff !important;
    text-decoration: none;
}
.cmdc-btn.is-whatsapp {
    color: #16a34a;
    border-color: #cbe8d5;
}
.cmdc-btn.is-whatsapp:hover {
    background: #16a34a;
    border-color: #16a34a;
    color: #fff;
}
/* Destructive action: solid red, white glyph */
.cmdc-btn.is-danger,
.cmdc-btn.is-danger i {
    background: #e5484d;
    border-color: #e5484d;
    color: #fff;
}
.cmdc-btn.is-danger:hover {
    background: #c93338;
    border-color: #c93338;
    color: #fff;
}
.cmdc-btn.is-alert {
    color: #e5484d;
    border-color: #f3d3d4;
}
.cmdc-btn.is-success {
    color: #16a34a;
    border-color: #cbe8d5;
}
.cmdc-btn.is-info {
    color: #2f7fe0;
    border-color: #cfe1f7;
}
.cmdc-more {
    position: relative;
    flex: none;
    width: 38px;
    height: 32px;
    border: 1px solid var(--cmdc-line);
    border-radius: 8px;
    background: #fff;
    color: #55607a;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.cmdc-more:hover,
.cmdc-more.active {
    background: #232343;
    border-color: #232343;
    color: #fff;
}
.cmdc-more__count {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    border-radius: 999px;
    background: #f08527;
    color: #fff;
    font-size: 0.63rem;
    font-weight: 700;
    line-height: 17px;
}

/* ---------- Overflow sheet ---------- */
.cmdc-sheet {
    margin-top: 8px;
    padding: 6px;
    border: 1px solid var(--cmdc-line);
    border-radius: 10px;
    background: var(--cmdc-canvas);
}
.cmdc-sheet__item {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 10px;
    border-radius: 8px;
    color: #43506b;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
}
.cmdc-sheet__item:hover {
    background: #fff;
    color: #232343;
    text-decoration: none;
}
.cmdc-sheet__item i {
    width: 15px;
    text-align: center;
    color: #8a93a7;
}
.cmdc-sheet__item.is-danger,
.cmdc-sheet__item.is-danger i {
    color: #e5484d;
}
/* Two tickets per row from tablet up: equal heights */
@media (min-width: 576px) {
    .cmdc-ticket {
        height: calc(100% - 12px);
    }
}
