/* ============================================================
   CAISSE / POS — Feuille de style principale (version moderne)
   Structure : Tokens → Base → Layout → POS → Composants → Responsive
   ============================================================ */

/* ---------- 1. DESIGN TOKENS ---------- */
:root {
    /* Couleurs principales */
    --primary: #2563eb;
    --primary-dark: #1e40af;
    --primary-light: #dbeafe;
    --primary-soft: #eff6ff;
    --primary-bright: #60a5fa;

    /* États */
    --success: #10b981;
    --success-soft: #d1fae5;
    --success-dark: #047857;
    --danger: #ef4444;
    --danger-soft: #fee2e2;
    --danger-dark: #b91c1c;
    --warning: #f59e0b;
    --warning-soft: #fef3c7;
    --warning-dark: #b45309;
    --info-soft: #dbeafe;

    /* Neutres */
    --dark: #1f2937;
    --darker: #111827;
    --gray: #6b7280;
    --gray-light: #9ca3af;
    --light: #f3f4f6;
    --lighter: #f9fafb;
    --border: #e5e7eb;

    /* Rayons */
    --radius-sm: 6px;
    --radius: 8px;
    --radius-lg: 12px;
    --radius-full: 999px;

    /* Ombres */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.15);
    --shadow-primary: 0 4px 12px rgba(37, 99, 235, 0.25);

    /* Transitions */
    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    /* Layout */
    --sidebar-width: 240px;
    --z-sidebar: 100;
    --z-modal: 1000;
    --z-toast: 2000;
}

/* ---------- 2. BASE ---------- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    line-height: 1.6;
    background: var(--lighter);
    color: var(--dark);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

/* Scrollbar moderne */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: var(--radius-full);
    transition: background var(--transition);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--gray-light);
}

/* ---------- 3. LAYOUT ---------- */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar améliorée */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--dark), var(--darker));
    color: #fff;
    padding: 24px 0;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: var(--z-sidebar);
    display: flex;
    flex-direction: column;
}

.sidebar .logo {
    padding: 0 20px 24px;
    margin-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--primary-bright);
}

.sidebar nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px 12px;
}

.sidebar nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: #9ca3af;
    text-decoration: none;
    border-radius: var(--radius);
    transition: all var(--transition);
    font-weight: 500;
    position: relative;
}

.sidebar nav a:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.sidebar nav a.active {
    background: var(--primary);
    color: #fff;
    box-shadow: var(--shadow-primary);
}

.sidebar nav a .icon {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 24px 32px 32px;
    min-width: 0;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 24px;
}

.page-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.page-header .subtitle {
    color: var(--gray);
    font-size: 0.95rem;
}

/* ---------- 4. INTERFACE POS ---------- */
.pos-container {
    display: grid;
    grid-template-columns: 1fr 420px;
    gap: 24px;
    height: calc(100vh - 100px);
    min-height: 500px;
}

/* Produits */
.pos-products {
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 20px;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 14px;
    align-content: start;
    box-shadow: var(--shadow-sm);
}

/* Barre de recherche */
.pos-search {
    grid-column: 1 / -1;
    position: relative;
}

.pos-search .form-control {
    padding-left: 44px;
    border-radius: var(--radius);
    background: var(--lighter);
    border: 2px solid transparent;
    transition: all var(--transition);
}

.pos-search .form-control:focus {
    background: #fff;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-soft);
}

.pos-search .search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-light);
    pointer-events: none;
    font-size: 1rem;
}

/* Carte produit */
.product-card {
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 12px;
    cursor: pointer;
    text-align: center;
    background: #fff;
    user-select: none;
    transition: all var(--transition);
    position: relative;
}

.product-card:hover {
    border-color: var(--primary);
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.product-card:active {
    transform: translateY(-2px) scale(0.98);
}

.product-card .name {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.6rem;
}

.product-card .price {
    color: var(--primary);
    font-weight: 700;
    font-size: 1.1rem;
}

.product-card .stock {
    font-size: 0.75rem;
    color: var(--gray);
    margin-top: 6px;
}

.product-card .stock.low {
    color: var(--warning);
    font-weight: 600;
}

.product-card .badge {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 0.65rem;
    padding: 2px 8px;
}

.product-card.out-of-stock {
    opacity: 0.5;
    filter: grayscale(0.6);
    cursor: not-allowed;
}

.product-card.out-of-stock:hover {
    transform: none;
    box-shadow: none;
    border-color: var(--border);
}

/* ---------- 5. PANIER ---------- */
.pos-cart {
    background: #fff;
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}

.cart-header {
    padding: 16px 20px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    font-weight: 700;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.cart-header .count {
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-full);
    padding: 2px 14px;
    font-size: 0.8rem;
    font-weight: 600;
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 8px 12px;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 12px 8px;
    border-bottom: 1px solid var(--border);
    animation: slideUp 0.25s ease;
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-item .info {
    flex: 1;
    min-width: 0;
}

.cart-item .info .name {
    font-weight: 600;
    font-size: 0.9rem;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cart-item .info .meta {
    font-size: 0.78rem;
    color: var(--gray);
}

.cart-item .info .serial-badge {
    display: inline-block;
    background: var(--primary-soft);
    color: var(--primary-dark);
    padding: 1px 10px;
    border-radius: var(--radius-full);
    font-family: 'Courier New', monospace;
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 4px;
}

.cart-item .remove {
    color: var(--danger);
    cursor: pointer;
    border: none;
    background: none;
    padding: 6px 8px;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
    font-size: 1.1rem;
}

.cart-item .remove:hover {
    background: var(--danger-soft);
    transform: scale(1.1);
}

/* Contrôles de quantité */
.qty-controls {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.qty-btn {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border: 1px solid var(--border);
    background: #fff;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 700;
    color: var(--dark);
    transition: all var(--transition);
    font-size: 0.9rem;
}

.qty-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-soft);
}

.qty-btn:active {
    transform: scale(0.9);
}

.qty-value {
    min-width: 24px;
    text-align: center;
    font-weight: 600;
    font-size: 0.95rem;
}

/* Résumé panier */
.cart-summary {
    padding: 16px 20px;
    background: var(--light);
    border-top: 2px solid var(--border);
    flex-shrink: 0;
}

.cart-summary .row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
    font-size: 0.95rem;
}

.cart-summary .total {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--primary);
    border-top: 2px solid var(--border);
    padding-top: 12px;
    margin-top: 10px;
    margin-bottom: 14px;
}

.cart-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

/* ---------- 6. BOUTONS ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 24px;
    border: 2px solid transparent;
    border-radius: var(--radius);
    cursor: pointer;
    font: inherit;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: all var(--transition);
    min-height: 44px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn:active {
    transform: translateY(0) scale(0.98);
}

.btn:disabled,
.btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    box-shadow: var(--shadow-primary);
}

.btn-success {
    background: var(--success);
    color: #fff;
    border-color: var(--success);
}

.btn-success:hover {
    background: var(--success-dark);
    border-color: var(--success-dark);
}

.btn-danger {
    background: var(--danger);
    color: #fff;
    border-color: var(--danger);
}

.btn-danger:hover {
    background: var(--danger-dark);
    border-color: var(--danger-dark);
}

.btn-outline {
    background: transparent;
    border-color: var(--border);
    color: var(--dark);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-soft);
}

.btn-block {
    width: 100%;
    justify-content: center;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.85rem;
    min-height: 34px;
}

.btn-lg {
    padding: 14px 32px;
    font-size: 1.1rem;
    min-height: 54px;
}

/* ---------- 7. CARTES & KPI ---------- */
.card {
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
    border: 1px solid var(--border);
}

.card h3 {
    margin-bottom: 16px;
    font-size: 1.1rem;
    font-weight: 700;
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.kpi-card {
    background: #fff;
    padding: 20px 24px;
    border-radius: var(--radius);
    border-left: 4px solid var(--primary);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition);
    border: 1px solid var(--border);
    border-left-width: 4px;
}

.kpi-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.kpi-card .label {
    color: var(--gray);
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.kpi-card .value {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.kpi-card .trend {
    font-size: 0.8rem;
    margin-top: 4px;
}

.kpi-card .trend.up {
    color: var(--success);
}

.kpi-card .trend.down {
    color: var(--danger);
}

.kpi-card.success {
    border-left-color: var(--success);
}

.kpi-card.danger {
    border-left-color: var(--danger);
}

.kpi-card.warning {
    border-left-color: var(--warning);
}

/* ---------- 8. FORMULAIRES ---------- */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 0.9rem;
}

.form-group .required {
    color: var(--danger);
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font: inherit;
    background: #fff;
    transition: all var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-soft);
}

.form-control:disabled,
.form-control[readonly] {
    background: var(--light);
    cursor: not-allowed;
    opacity: 0.7;
}

select.form-control {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

/* ---------- 9. TABLEAUX ---------- */
.table-wrapper {
    overflow-x: auto;
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}

table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    font-size: 0.95rem;
}

table th,
table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

table th {
    background: var(--light);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray);
    position: sticky;
    top: 0;
    z-index: 2;
}

table tbody tr {
    transition: background var(--transition);
}

table tbody tr:hover {
    background: var(--primary-soft);
}

/* ---------- 10. BADGES ---------- */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.3;
    white-space: nowrap;
}

.badge-success {
    background: var(--success-soft);
    color: var(--success-dark);
}

.badge-danger {
    background: var(--danger-soft);
    color: var(--danger-dark);
}

.badge-warning {
    background: var(--warning-soft);
    color: var(--warning-dark);
}

.badge-info {
    background: var(--info-soft);
    color: var(--primary-dark);
}

/* ---------- 11. MODALES ---------- */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(17, 24, 39, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: var(--z-modal);
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
    animation: fadeIn 0.25s ease;
}

.modal {
    position: relative;
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 32px;
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: modalIn 0.3s ease;
}

.modal h2 {
    margin-bottom: 20px;
    font-size: 1.3rem;
    font-weight: 700;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border: none;
    border-radius: 50%;
    background: var(--light);
    color: var(--gray);
    cursor: pointer;
    transition: all var(--transition);
    font-size: 1.2rem;
}

.modal-close:hover {
    background: var(--danger-soft);
    color: var(--danger);
}

/* ---------- 12. CRÉDIT ---------- */
.credit-calc {
    background: var(--warning-soft);
    border: 2px solid var(--warning);
    border-radius: var(--radius);
    padding: 16px 20px;
    margin: 16px 0;
}

.installment-preview {
    margin-top: 16px;
    background: #fff;
    border-radius: var(--radius);
    padding: 12px;
    max-height: 220px;
    overflow-y: auto;
    border: 1px solid var(--border);
}

.installment-preview .inst-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 4px;
    border-bottom: 1px dashed var(--border);
    font-size: 0.9rem;
}

.installment-preview .inst-row:last-child {
    border-bottom: none;
}

.installment-preview .inst-row.overdue {
    color: var(--danger);
    font-weight: 600;
}

/* ---------- 13. TOASTS ---------- */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: var(--z-toast);
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 360px;
}

.toast {
    background: var(--dark);
    color: #fff;
    padding: 14px 20px;
    border-radius: var(--radius);
    border-left: 4px solid var(--primary);
    box-shadow: var(--shadow-lg);
    font-size: 0.9rem;
    animation: toastIn 0.4s ease;
    display: flex;
    align-items: center;
    gap: 12px;
}

.toast .icon {
    font-size: 1.2rem;
}

.toast.success {
    border-left-color: var(--success);
}

.toast.danger {
    border-left-color: var(--danger);
}

.toast.warning {
    border-left-color: var(--warning);
}

.toast.leaving {
    animation: toastOut 0.3s ease forwards;
}

/* ---------- 14. ÉTATS ---------- */
.empty-state {
    text-align: center;
    padding: 48px 20px;
    color: var(--gray);
}

.empty-state .icon {
    font-size: 3rem;
    margin-bottom: 12px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 0.95rem;
    max-width: 400px;
    margin: 0 auto;
}

.spinner {
    width: 28px;
    height: 28px;
    border: 3px solid var(--primary-soft);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

/* ---------- 15. ANIMATIONS ---------- */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(16px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(100%) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes toastOut {
    to {
        opacity: 0;
        transform: translateX(100%) scale(0.95);
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ---------- 16. RESPONSIVE ---------- */
@media (max-width: 1200px) {
    .pos-container {
        grid-template-columns: 1fr 360px;
    }
}

@media (max-width: 992px) {
    .pos-container {
        grid-template-columns: 1fr;
        height: auto;
        gap: 16px;
    }

    .pos-cart {
        position: sticky;
        bottom: 0;
        max-height: 55vh;
        z-index: 50;
        box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.1);
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    }

    .pos-products {
        max-height: 60vh;
    }
}

@media (max-width: 768px) {
    .sidebar {
        top: auto;
        bottom: 0;
        width: 100%;
        height: auto;
        padding: 0;
        overflow-x: auto;
        overflow-y: hidden;
        flex-direction: row;
        background: var(--dark);
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }

    .sidebar .logo {
        display: none;
    }

    .sidebar nav {
        flex-direction: row;
        padding: 4px 8px;
        width: 100%;
        justify-content: space-around;
    }

    .sidebar nav a {
        flex: 1;
        flex-direction: column;
        gap: 2px;
        padding: 8px 6px;
        font-size: 0.7rem;
        text-align: center;
        border-radius: var(--radius-sm);
        min-width: 50px;
    }

    .sidebar nav a .icon {
        font-size: 1.1rem;
    }

    .sidebar nav a.active {
        background: var(--primary);
        color: #fff;
    }

    .main-content {
        margin-left: 0;
        padding: 16px 16px 80px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .kpi-grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .cart-actions {
        grid-template-columns: 1fr;
    }

    .toast-container {
        left: 16px;
        right: 16px;
        top: 16px;
        max-width: 100%;
    }

    .toast {
        min-width: 0;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .kpi-grid {
        grid-template-columns: 1fr;
    }

    .pos-products {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        padding: 12px;
        gap: 10px;
    }

    .page-header h1 {
        font-size: 1.3rem;
    }

    .modal {
        padding: 20px;
        margin: 10px;
    }
}

/* ---------- 17. TOUCHES ---------- */
@media (pointer: coarse) {
    .btn {
        min-height: 48px;
        padding: 12px 20px;
    }

    .product-card {
        padding: 16px 10px;
    }

    .qty-btn {
        width: 36px;
        height: 36px;
    }

    .form-control,
    select.form-control {
        min-height: 48px;
        font-size: 1rem;
    }

    .sidebar nav a {
        padding: 10px 6px;
    }
}

/* ---------- 18. IMPRESSION ---------- */
@media print {
    .sidebar,
    .btn,
    .toast-container,
    .modal-overlay,
    .cart-header,
    .cart-actions,
    .pos-search {
        display: none !important;
    }

    .main-content {
        margin: 0;
        padding: 0;
    }

    body {
        background: #fff;
    }

    .card,
    .kpi-card,
    table,
    .pos-products,
    .pos-cart {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }

    .pos-container {
        display: block;
        height: auto;
    }

    .pos-products {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
    }
}

/* ---------- 19. ACCESSIBILITÉ ---------- */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    html {
        scroll-behavior: auto;
    }
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ---------- 20. COMPOSANTS POS SPÉCIFIQUES ---------- */

/* Recherche client */
.customer-search-wrapper {
    position: relative;
    margin-bottom: 16px;
}

.customer-search-input {
    width: 100%;
    padding: 12px 44px 12px 14px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    transition: all var(--transition);
}

.customer-search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-soft);
}

.customer-search-icon {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-light);
    font-size: 1.1rem;
    pointer-events: none;
}

.customer-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    max-height: 380px;
    overflow-y: auto;
    z-index: 100;
    margin-top: 6px;
    display: none;
}

.customer-dropdown.active {
    display: block;
    animation: slideUp 0.2s ease;
}

.customer-item {
    padding: 12px 16px;
    border-bottom: 1px solid var(--light);
    cursor: pointer;
    transition: all var(--transition);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.customer-item:hover,
.customer-item.highlighted {
    background: var(--primary-soft);
}

.customer-item:last-child {
    border-bottom: none;
}

.customer-item .main-info .name {
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 2px;
}

.customer-item .main-info .meta {
    font-size: 0.85rem;
    color: var(--gray);
}

.customer-item .badges {
    display: flex;
    gap: 6px;
    flex-direction: column;
    align-items: flex-end;
}

.customer-item .debt-badge {
    background: var(--danger-soft);
    color: var(--danger-dark);
    padding: 2px 12px;
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 600;
}

.customer-item .late-badge {
    background: var(--warning-soft);
    color: var(--warning-dark);
    padding: 2px 12px;
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 600;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

.customer-dropdown-footer {
    padding: 12px 16px;
    background: var(--lighter);
    border-top: 1px solid var(--border);
    border-radius: 0 0 var(--radius) var(--radius);
}

.customer-dropdown-footer button {
    width: 100%;
    padding: 10px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all var(--transition);
}

.customer-dropdown-footer button:hover {
    background: var(--primary-dark);
}

/* Client sélectionné */
.selected-customer {
    background: linear-gradient(135deg, var(--primary-soft), var(--primary-light));
    border: 2px solid var(--primary);
    border-radius: var(--radius);
    padding: 16px 20px;
    margin-bottom: 16px;
    position: relative;
}

.selected-customer .header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 8px;
}

.selected-customer .name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-dark);
}

.selected-customer .contact {
    font-size: 0.85rem;
    color: var(--gray);
    margin-top: 2px;
}

.selected-customer .remove-btn {
    background: transparent;
    border: none;
    color: var(--danger);
    cursor: pointer;
    font-size: 1.3rem;
    padding: 0 4px;
    transition: all var(--transition);
}

.selected-customer .remove-btn:hover {
    transform: scale(1.2);
}

.selected-customer .info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed var(--primary-bright);
    font-size: 0.85rem;
}

.selected-customer .info-item {
    display: flex;
    justify-content: space-between;
}

.selected-customer .info-item .label {
    color: var(--gray);
}

.selected-customer .info-item .value {
    font-weight: 600;
}

.alert-customer {
    background: var(--danger-soft);
    border-left: 4px solid var(--danger);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    margin-top: 10px;
    font-size: 0.85rem;
    color: var(--danger-dark);
}

.alert-customer.warning {
    background: var(--warning-soft);
    border-left-color: var(--warning);
    color: var(--warning-dark);
}

/* Loader recherche */
.search-loader {
    position: absolute;
    right: 44px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    border: 2px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    display: none;
}

.search-loader.active {
    display: block;
}

/* Modal création rapide */
.quick-create-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.quick-create-form .form-group {
    margin-bottom: 12px;
}

.quick-create-form label {
    font-size: 0.85rem;
    margin-bottom: 4px;
    font-weight: 600;
}

.quick-create-form .form-control {
    padding: 8px 12px;
    font-size: 0.9rem;
}

/* Sélecteur de série */
.serial-modal {
    max-width: 600px;
}

.serial-search-box {
    margin-bottom: 16px;
}

.serial-search-box input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    transition: all var(--transition);
}

.serial-search-box input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-soft);
}

.serial-list {
    max-height: 350px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.serial-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--light);
    cursor: pointer;
    transition: all var(--transition);
}

.serial-item:hover {
    background: var(--primary-soft);
}

.serial-item:last-child {
    border-bottom: none;
}

.serial-item .serial-number {
    font-family: 'Courier New', monospace;
    font-weight: 700;
    font-size: 1rem;
    color: var(--dark);
}

.serial-item .serial-meta {
    font-size: 0.85rem;
    color: var(--gray);
}

.serial-item .select-btn {
    padding: 6px 16px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all var(--transition);
}

.serial-item .select-btn:hover {
    background: var(--primary-dark);
}

.serial-empty {
    padding: 40px;
    text-align: center;
    color: var(--gray-light);
}

/* Scan rapide */
.scan-section {
    background: var(--success-soft);
    border: 2px solid var(--success);
    border-radius: var(--radius);
    padding: 10px 16px;
    margin-bottom: 12px;
    display: flex;
    gap: 12px;
    align-items: center;
}

.scan-section input {
    flex: 1;
    padding: 8px 14px;
    border: 2px solid var(--success);
    border-radius: var(--radius-sm);
    font-family: 'Courier New', monospace;
    font-size: 0.95rem;
    background: #fff;
    transition: all var(--transition);
}

.scan-section input:focus {
    outline: none;
    border-color: var(--success-dark);
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.2);
}

.scan-section button {
    padding: 8px 20px;
    background: var(--success);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 600;
    transition: all var(--transition);
    white-space: nowrap;
}

.scan-section button:hover {
    background: var(--success-dark);
}