/* Comptra.Cashier — styles applicatifs (panier, caisses, modales paiement, layout) */

.main-container {
    display: grid;
    grid-template-columns: 1fr 420px;
    height: calc(100vh - var(--header-height, 115px));
    overflow: hidden;
}

#menu-alpha {
    overflow-y: auto;
    background: #fff;
    border-right: 1px solid #dee2e6;
    min-width: 0;
}

#menu-beta {
    overflow-y: auto;
    background: #fdfdfd;
    min-width: 0;
}

@media (max-width: 992px) {
    .main-container {
        grid-template-columns: 1fr;
        height: auto;
        overflow: visible;
    }

    #menu-alpha {
        border-right: 0;
        border-bottom: 1px solid #dee2e6;
    }
}

.filter-section {
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.article-card {
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.article-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.08);
}

/* Barre onglets — Caisses ouvertes (voir style.css pour la version complète) */
.vmware-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(180deg, #f8f9fa 0%, #f1f3f5 100%);
    border: 1px solid #dee2e6;
    border-radius: 12px;
    padding: 8px 10px;
    min-height: 52px;
    overflow-x: auto;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.vmware-bar__label {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #495057;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    padding: 6px 12px;
    white-space: nowrap;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    flex-shrink: 0;
}

.vmware-bar__tabs {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    min-width: 0;
}

.vmware-bar__empty {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #868e96;
    font-size: 12px;
    font-style: italic;
}

.caisse-window {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 10px 7px 12px;
    background: #fff;
    color: #495057;
    border: 1.5px solid #dee2e6;
    border-radius: 9px;
    cursor: pointer;
    font-size: 12px;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.caisse-window:hover {
    background: #f8f9fa;
    border-color: #adb5bd;
}

.caisse-window.active {
    background: linear-gradient(180deg, #1D9E75 0%, #178a65 100%);
    color: #fff;
    border-color: #0F6E56;
    box-shadow: 0 2px 10px rgba(29, 158, 117, 0.35);
}

.caisse-window--virtual {
    border-style: dashed;
    border-color: #74c0fc;
    background: #e7f5ff;
    color: #1864ab;
}

.caisse-window--virtual.active {
    background: linear-gradient(180deg, #339af0 0%, #228be6 100%);
    border-color: #1c7ed6;
    border-style: solid;
    color: #fff;
}

.caisse-window__total {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.08);
}

.caisse-window.active .caisse-window__total {
    background: rgba(255, 255, 255, 0.22);
}

.caisse-window__status {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #adb5bd;
    flex-shrink: 0;
}

.caisse-window.active .caisse-window__status {
    background: #9FE1CB;
    box-shadow: 0 0 8px #9FE1CB;
}

.caisse-window__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: inherit;
    opacity: 0.55;
    cursor: pointer;
    font-size: 11px;
}

.caisse-window__close:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.1);
}

.panier-wrap {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.panier-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.btn-client,
.btn-vider {
    border: none;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.15s;
}

.btn-client {
    background: #e8f0fe;
    color: #185fa5;
}

.btn-client.has-client {
    background: #e1f5ee;
    color: #0f6e56;
}

.btn-vider {
    background: #fee2e2;
    color: #b91c1c;
}

.btn-client:hover,
.btn-vider:hover { opacity: 0.88; }

.panier-items {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 320px;
    overflow-y: auto;
}

.panier-empty {
    text-align: center;
    color: #aaa;
    font-size: 13px;
    padding: 24px 8px;
}

.item-row {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border: 1px solid #eee;
    border-radius: 8px;
    background: #fff;
}

.item-name {
    font-size: 13px;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.item-qty-ctrl {
    display: flex;
    align-items: center;
    gap: 4px;
}

.qty-btn {
    width: 26px;
    height: 26px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
}

.qty-btn:hover { background: #f5f5f5; }

.qty-input {
    width: 42px;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 13px;
    padding: 2px;
}

.qty-num { min-width: 20px; text-align: center; font-size: 13px; }

.item-price {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

.recap {
    border-top: 1px solid #eee;
    padding-top: 10px;
    margin-top: 4px;
}

.recap-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    padding: 3px 0;
    color: #555;
}

.recap-row.total {
    font-weight: 700;
    font-size: 15px;
    color: #111;
    border-top: 1px solid #eee;
    margin-top: 6px;
    padding-top: 8px;
}

.panier-title {
    font-size: 15px;
    font-weight: 600;
}

.payments-summary {
    font-size: 12px;
    color: #555;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 8px 10px;
}

.btn-pay, .btn-cheque {
    border: none;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.15s;
}

.btn-pay { flex: 1; }
.btn-cash { background: #E1F5EE; color: #0F6E56; }
.btn-card { background: #E8F0FE; color: #185FA5; }
.btn-cheque { width: 100%; margin-top: 8px; background: #f1f3f5; color: #495057; }
.btn-pay:hover, .btn-cheque:hover { opacity: 0.88; }

.payments-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.pm-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1050;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.pm-overlay.active {
    opacity: 1;
    pointer-events: all;
}

#modal-invoice.active {
    z-index: 1060;
}

.pm-modal.invoice-modal {
    width: 720px;
    max-width: calc(100vw - 24px);
}

.pm-modal {
    background: #fff;
    border-radius: 14px;
    width: 440px;
    max-width: calc(100vw - 24px);
    max-height: calc(100vh - 40px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18);
}

.pm-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    border-bottom: 1px solid #eee;
}

.pm-head h2 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.pm-body {
    padding: 16px 18px;
    overflow-y: auto;
}

.pm-foot {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 18px 16px;
    border-top: 1px solid #eee;
}

.pm-close {
    background: none;
    border: none;
    color: #888;
    cursor: pointer;
    font-size: 16px;
    padding: 4px;
}

.pm-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.pm-icon.green { background: #E1F5EE; color: #0F6E56; }
.pm-icon.blue { background: #E8F0FE; color: #185FA5; }
.pm-icon.gray { background: #f1f3f5; color: #495057; }

.pm-field { margin-bottom: 12px; }
.pm-field label { display: block; font-size: 12px; font-weight: 600; color: #555; margin-bottom: 4px; }
.pm-field input, .pm-field select {
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 14px;
}

.pm-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.pm-total-banner {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pm-total-label { font-size: 12px; color: #666; }
.pm-total-amt { font-size: 20px; font-weight: 700; }

.pm-reste-hint { font-size: 11px; color: #888; }

.pm-info-box {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 12px;
}

.pm-info-box.warn { background: #fff4e5; color: #92400e; border: 1px solid #fcd34d; }
.pm-info-box.blue { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }

.pm-btn-cancel, .pm-btn-confirm {
    flex: 1;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
}

.pm-btn-cancel { background: #f1f3f5; color: #495057; border-color: #dee2e6; }
.pm-btn-confirm.green { background: #1D9E75; color: #fff; }
.pm-btn-confirm.blue { background: #185FA5; color: #fff; }
.pm-btn-confirm:disabled { opacity: 0.5; cursor: not-allowed; }

.pm-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #eee;
    border-top-color: #185FA5;
    border-radius: 50%;
    animation: pmSpin 0.8s linear infinite;
}

@keyframes pmSpin { to { transform: rotate(360deg); } }

.pm-anim-center { text-align: center; padding: 20px 0; }
.pm-anim-label { font-size: 13px; color: #666; margin-top: 8px; }
.pm-anim-title { font-size: 16px; font-weight: 700; margin: 8px 0 4px; }

.pm-success-circle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #E1F5EE;
    color: #0F6E56;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.pm-change-wrap { margin-top: 10px; font-size: 13px; }
.pm-change-row { display: flex; justify-content: space-between; padding: 4px 0; }
