/* ============= VARIABLES CSS ============= */
:root {
    /* Couleurs principales */
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary: #10b981;
    --secondary-dark: #059669;
    --accent: #f59e0b;
    --danger: #ef4444;
    --warning: #f59e0b;
    --success: #10b981;
    --info: #3b82f6;
    
    /* Couleurs neutres */
    --dark: #1e293b;
    --dark-light: #334155;
    --gray: #64748b;
    --gray-light: #cbd5e1;
    --gray-lighter: #f1f5f9;
    --white: #ffffff;
    
    /* Layout */
    --sidebar-width: 240px;
    --sidebar-collapsed-width: 70px;
    --header-height: 56px;
    --footer-height: 48px;
    
    /* Ombres */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    
    /* Espacements */
    --spacing-xs: 0.2rem;
    --spacing-sm: 0.4rem;
    --spacing-md: 0.75rem;
    --spacing-lg: 1rem;
    --spacing-xl: 1.25rem;
    --spacing-2xl: 2rem;
    
    /* Bordures */
    --radius-sm: 0.375rem;
    --radius: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-full: 9999px;
    
    /* Transitions */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============= RESET & BASE ============= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--gray-lighter);
    color: var(--dark);
    line-height: 1.5;
    font-size: 13px;
    overflow-x: hidden;
}

/* ============= SCROLLBAR ============= */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--gray-lighter);
}

::-webkit-scrollbar-thumb {
    background: var(--gray);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--dark-light);
}

/* ============= HEADER MODERNE ============= */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--white);
    border-bottom: 1px solid var(--gray-light);
    box-shadow: var(--shadow-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 var(--spacing-lg);
    z-index: 1000;
}

.header-left {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
}

.sidebar-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--spacing-sm);
    border-radius: var(--radius);
    transition: var(--transition-fast);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sidebar-toggle:hover {
    background: var(--gray-lighter);
}

.hamburger {
    width: 24px;
    height: 3px;
    background: var(--dark);
    border-radius: var(--radius-full);
    transition: var(--transition-fast);
}

.header-brand h1 {
    font-size: 1.2rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary) 0%, var(--info) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
    line-height: 1.2;
}

.header-subtitle {
    font-size: 0.65rem;
    color: var(--gray);
    display: block;
    margin-top: -2px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
}

.header-user {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.user-avatar {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--primary) 0%, var(--info) 100%);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 600;
    color: var(--dark);
    font-size: 0.8rem;
    line-height: 1.2;
}

.user-role {
    font-size: 0.68rem;
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.header-logout {
    white-space: nowrap;
}

/* ============= SIDEBAR MODERNE ============= */
.app-sidebar {
    position: fixed;
    top: var(--header-height);
    left: 0;
    width: var(--sidebar-width);
    height: calc(100vh - var(--header-height));
    background: var(--white);
    border-right: 1px solid var(--gray-light);
    box-shadow: var(--shadow-sm);
    overflow-y: auto;
    overflow-x: hidden;
    transition: var(--transition);
    z-index: 999;
}

.app-sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

.app-sidebar.collapsed .sidebar-text {
    opacity: 0;
    width: 0;
}

.app-sidebar.collapsed .sidebar-title {
    opacity: 0;
    width: 0;
}

.app-sidebar.collapsed .sidebar-section-title {
    opacity: 0;
    height: 0;
    margin: 0;
}

.app-sidebar.collapsed .sidebar-footer-info {
    opacity: 0;
}

.sidebar-header {
    padding: var(--spacing-lg);
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    border-bottom: 1px solid var(--gray-light);
}

.sidebar-logo {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--primary) 0%, var(--info) 100%);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.sidebar-title {
    font-weight: 700;
    color: var(--dark);
    white-space: nowrap;
    transition: var(--transition);
    font-size: 0.9rem;
}

.sidebar-nav {
    padding: var(--spacing-md) 0;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: 0.55rem 0.85rem;
    color: var(--dark);
    text-decoration: none;
    transition: var(--transition-fast);
    position: relative;
    font-size: 0.85rem;
}

.sidebar-link:hover {
    background: var(--gray-lighter);
    color: var(--primary);
}

.sidebar-link.active {
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.1) 0%, transparent 100%);
    color: var(--primary);
    border-left: 3px solid var(--primary);
}

.sidebar-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--primary);
}

.sidebar-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
    width: 20px;
    text-align: center;
}

.sidebar-text {
    white-space: nowrap;
    transition: var(--transition);
    font-weight: 500;
}

.sidebar-divider {
    height: 1px;
    background: var(--gray-light);
    margin: 0.5rem 0.85rem;
}

.sidebar-section-title {
    padding: 0.5rem 0.85rem;
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: var(--transition);
}

.sidebar-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: var(--spacing-lg);
    border-top: 1px solid var(--gray-light);
    background: var(--white);
}

.sidebar-footer-info {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
    font-size: 0.7rem;
    color: var(--gray);
    transition: var(--transition);
}

/* ============= MAIN CONTENT ============= */
.app-main {
    margin-left: var(--sidebar-width);
    margin-top: var(--header-height);
    min-height: calc(100vh - var(--header-height) - var(--footer-height));
    transition: var(--transition);
    padding-bottom: var(--footer-height);
}

body.sidebar-collapsed .app-main {
    margin-left: var(--sidebar-collapsed-width);
}

.app-content {
    padding: var(--spacing-lg);
    max-width: 1600px;
    margin: 0 auto;
}

/* ============= FOOTER ============= */
.app-footer {
    position: fixed;
    bottom: 0;
    left: var(--sidebar-width);
    right: 0;
    height: var(--footer-height);
    background: var(--white);
    border-top: 1px solid var(--gray-light);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    z-index: 998;
}

body.sidebar-collapsed .app-footer {
    left: var(--sidebar-collapsed-width);
}

.footer-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 1600px;
    padding: 0 var(--spacing-lg);
    color: var(--gray);
    font-size: 0.8rem;
}

.footer-links {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

/* ============= PAGE HEADER ============= */
.page-header {
    margin-bottom: var(--spacing-lg);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: var(--spacing-xs);
}

.page-subtitle {
    color: var(--gray);
    font-size: 0.85rem;
}

.btn-group {
    display: inline-flex;
    border-radius: 6px;
    overflow: hidden;
}

.btn-group .btn {
    border-radius: 0;
    border-right: 1px solid rgba(99, 102, 241, 0.2);
}

.btn-group .btn:first-child {
    border-top-left-radius: 6px;
    border-bottom-left-radius: 6px;
}

.btn-group .btn:last-child {
    border-top-right-radius: 6px;
    border-bottom-right-radius: 6px;
    border-right: none;
}

.btn-group .btn-primary {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: white;
    border-color: #6366f1;
}

.btn-group .btn-outline-primary {
    background: white;
    color: #6366f1;
    border-color: rgba(99, 102, 241, 0.3);
}

.btn-group .btn-outline-primary:hover {
    background: rgba(99, 102, 241, 0.1);
}

/* ============= CARDS ============= */
.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-md);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.card-header {
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-md);
    border-bottom: 2px solid var(--gray-lighter);
}

.card-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

/* ============= STATS CARDS ============= */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.stat-card {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    color: var(--white);
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

.stat-card.success {
    background: linear-gradient(135deg, var(--success) 0%, var(--secondary-dark) 100%);
}

.stat-card.warning {
    background: linear-gradient(135deg, var(--warning) 0%, #ea580c 100%);
}

.stat-card.danger {
    background: linear-gradient(135deg, var(--danger) 0%, #dc2626 100%);
}

.stat-card.info {
    background: linear-gradient(135deg, var(--info) 0%, #2563eb 100%);
}

.stat-icon {
    font-size: 1.75rem;
    opacity: 0.9;
    margin-bottom: var(--spacing-sm);
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: var(--spacing-xs);
}

.stat-label {
    font-size: 0.75rem;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.usd-amount {
    font-size: 0.85rem;
    opacity: 0.8;
    display: block;
    margin-top: var(--spacing-xs);
}

/* ============= BUTTONS ============= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: 0.4rem 0.85rem;
    border: none;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 0.8rem;
    cursor: pointer;
    transition: var(--transition-fast);
    text-decoration: none;
    white-space: nowrap;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-success {
    background: var(--success);
    color: var(--white);
}

.btn-success:hover {
    background: var(--secondary-dark);
}

.btn-danger {
    background: var(--danger);
    color: var(--white);
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-warning {
    background: var(--warning);
    color: var(--white);
}

.btn-warning:hover {
    background: #ea580c;
}

.btn-secondary {
    background: var(--gray);
    color: var(--white);
}

.btn-secondary:hover {
    background: var(--dark-light);
}

.btn-info {
    background: var(--info);
    color: var(--white);
}

.btn-info:hover {
    background: #2563eb;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: var(--white);
}

.btn-outline-primary {
    background: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
}

.btn-outline-primary:hover {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

.btn-outline-primary.active {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

.btn-outline-warning {
    background: transparent;
    border: 1px solid var(--warning);
    color: var(--warning);
}

.btn-outline-warning:hover {
    background: var(--warning);
    color: var(--white);
    border-color: var(--warning);
}

.btn-outline-warning.active {
    background: var(--warning);
    color: var(--white);
    border-color: var(--warning);
}

.btn-outline-success {
    background: transparent;
    border: 1px solid var(--success);
    color: var(--success);
}

.btn-outline-success:hover {
    background: var(--success);
    color: var(--white);
    border-color: var(--success);
}

.btn-outline-success.active {
    background: var(--success);
    color: var(--white);
    border-color: var(--success);
}

.btn-outline-danger {
    background: transparent;
    border: 1px solid var(--danger);
    color: var(--danger);
}

.btn-outline-danger:hover {
    background: var(--danger);
    color: var(--white);
    border-color: var(--danger);
}

.btn-outline-danger.active {
    background: var(--danger);
    color: var(--white);
    border-color: var(--danger);
}

.btn-sm {
    padding: var(--spacing-xs) var(--spacing-md);
    font-size: 0.8rem;
}

.btn-lg {
    padding: var(--spacing-sm) var(--spacing-lg);
    font-size: 1rem;
}

/* ============= FORMS ============= */
.form-group {
    margin-bottom: var(--spacing-md);
}

.form-label {
    display: block;
    margin-bottom: var(--spacing-sm);
    color: var(--dark);
    font-weight: 600;
    font-size: 0.9rem;
}

.form-control {
    width: 100%;
    padding: var(--spacing-md);
    border: 2px solid var(--gray-light);
    border-radius: var(--radius);
    font-size: 0.95rem;
    transition: var(--transition-fast);
    background: var(--white);
    color: var(--dark);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-control:disabled {
    background: var(--gray-lighter);
    cursor: not-allowed;
}

select.form-control {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%236366f1' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-md);
}

/* ============= TABLES ============= */
.table-container {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
}

.table thead {
    background: var(--gray-lighter);
}

.table th {
    padding: 0.5rem 0.75rem;
    text-align: left;
    font-weight: 700;
    color: var(--dark);
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.3px;
    border-bottom: 2px solid var(--gray-light);
}

.table td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--gray-lighter);
    color: var(--dark);
    font-size: 0.85rem;
}

.table tbody tr {
    transition: var(--transition-fast);
}

.table tbody tr:hover {
    background: var(--gray-lighter);
}

/* ============= BADGES ============= */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 600;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.badge-info {
    background: rgba(59, 130, 246, 0.1);
    color: var(--info);
}

.badge-primary {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
}

/* ============= ALERTS ============= */
.alert {
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: var(--radius);
    margin-bottom: var(--spacing-lg);
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    font-weight: 500;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--secondary-dark);
    border-left: 4px solid var(--success);
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
    border-left: 4px solid var(--danger);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    color: #ea580c;
    border-left: 4px solid var(--warning);
}

.alert-info {
    background: rgba(59, 130, 246, 0.1);
    color: #2563eb;
    border-left: 4px solid var(--info);
}

/* ============= MODAL ============= */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    background: var(--white);
    margin: 5% auto;
    padding: 0;
    border-radius: var(--radius-lg);
    max-width: 600px;
    width: 90%;
    box-shadow: var(--shadow-xl);
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--gray-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--dark);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--gray);
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    transition: var(--transition-fast);
}

.modal-close:hover {
    background: var(--gray-lighter);
    color: var(--dark);
}

.modal-body {
    padding: var(--spacing-lg);
}

.modal-footer {
    padding: var(--spacing-lg);
    border-top: 1px solid var(--gray-light);
    display: flex;
    justify-content: flex-end;
    gap: var(--spacing-md);
}

/* ============= POS (POINT DE VENTE) - DESIGN MODERNE ============= */
.pos-container {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 1.5rem;
    min-height: calc(100vh - var(--header-height) - var(--footer-height) - 4rem);
    max-width: 1800px;
    margin: 0 auto;
}

.pos-products {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 24px;
    padding: 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.8);
}

.pos-cart {
    background: linear-gradient(180deg, #ffffff 0%, #fefefe 100%);
    border-radius: 24px;
    padding: 1.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - var(--header-height) - var(--footer-height) - 4rem);
    position: sticky;
    top: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.9);
}

.products-search {
    margin-bottom: 1.5rem;
}

.products-search .form-control {
    height: 56px;
    border-radius: 16px;
    border: 2px solid #e9ecef;
    font-size: 1rem;
    padding: 0 1.25rem;
    transition: all 0.3s ease;
    background: white;
}

.products-search .form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
    transform: translateY(-2px);
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1.25rem;
    padding: 0.5rem;
}

.product-card {
    background: white;
    border: 2px solid transparent;
    border-radius: 20px;
    padding: 1.25rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    position: relative;
    overflow: hidden;
}

.product-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--success));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.product-card:hover {
    border-color: var(--primary);
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 12px 32px rgba(59, 130, 246, 0.2);
}

.product-card:hover::before {
    opacity: 1;
}

.product-card:active {
    transform: translateY(-2px) scale(0.98);
}

.product-card.out-of-stock {
    opacity: 0.5;
    cursor: not-allowed;
    filter: grayscale(0.5);
}

.product-card.out-of-stock:hover {
    transform: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.products-search {
    margin-bottom: 1.5rem;
}

.products-search .form-control {
    height: 56px;
    border-radius: 16px;
    border: 2px solid #e9ecef;
    font-size: 1rem;
    padding: 0 1.25rem;
    transition: all 0.3s ease;
    background: white;
}

.products-search .form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
    transform: translateY(-2px);
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1.25rem;
    padding: 0.5rem;
}

.product-card {
    background: white;
    border: 2px solid transparent;
    border-radius: 20px;
    padding: 1.25rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    position: relative;
    overflow: hidden;
}

.product-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--success));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.product-card:hover {
    border-color: var(--primary);
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 12px 32px rgba(59, 130, 246, 0.2);
}

.product-card:hover::before {
    opacity: 1;
}

.product-card:active {
    transform: translateY(-2px) scale(0.98);
}

.product-card.out-of-stock {
    opacity: 0.5;
    cursor: not-allowed;
    filter: grayscale(0.5);
}

.product-card.out-of-stock:hover {
    transform: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.product-icon {
    margin-bottom: 0.875rem;
    width: 100%;
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.25);
}

.product-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 12px;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.product-emoji {
    font-size: 4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.15));
}

.product-card:hover .product-icon img {
    transform: scale(1.1) rotate(2deg);
}

.product-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: var(--radius);
    transition: transform 0.3s ease;
}

.product-card:hover .product-image {
    transform: scale(1.1);
}

.product-name {
    font-weight: 600;
    color: var(--dark);
    margin-bottom: var(--spacing-xs);
    font-size: 0.9rem;
}

.product-price {
    color: var(--primary);
    font-weight: 700;
    font-size: 0.9rem;
}

.product-stock {
    font-size: 0.7rem;
    color: var(--gray);
    margin-top: var(--spacing-xs);
}

.cart-header {
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-sm);
    border-bottom: 2px solid var(--gray-lighter);
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    margin-bottom: var(--spacing-md);
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-sm);
    background: var(--gray-lighter);
    border-radius: var(--radius);
    margin-bottom: var(--spacing-xs);
}

.cart-item-info {
    flex: 1;
}

.cart-item-name {
    font-weight: 600;
    color: var(--dark);
    margin-bottom: var(--spacing-xs);
}

.cart-item-price {
    color: var(--gray);
    font-size: 0.85rem;
}

.cart-item-controls {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.qty-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--primary);
    color: var(--white);
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 700;
    transition: var(--transition-fast);
}

.qty-btn:hover {
    background: var(--primary-dark);
}

.qty-btn.remove {
    background: var(--danger);
}

.qty-btn.remove:hover {
    background: #dc2626;
}

.cart-item-qty {
    min-width: 40px;
    text-align: center;
    font-weight: 700;
}

.cart-empty {
    text-align: center;
    padding: var(--spacing-xl);
    color: var(--gray);
}

.cart-empty-icon {
    font-size: 4rem;
    margin-bottom: var(--spacing-md);
    opacity: 0.3;
}

.cart-summary {
    border-top: 2px solid var(--gray-lighter);
    padding-top: var(--spacing-md);
}

.cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-md);
    padding: var(--spacing-sm);
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
    border-radius: var(--radius-md);
    color: var(--white);
}

.cart-total-label {
    font-size: 1rem;
    font-weight: 600;
}

.cart-total-value {
    font-size: 1.8rem;
    font-weight: 700;
}

.btn-checkout {
    width: 100%;
    padding: var(--spacing-lg);
    font-size: 1.1rem;
    background: var(--success);
    color: var(--white);
    border: none;
    border-radius: var(--radius-md);
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-checkout:hover {
    background: var(--secondary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-checkout:disabled {
    background: var(--gray);
    cursor: not-allowed;
    transform: none;
}

/* ============= PAYMENT MODAL ============= */
.payment-form {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.payment-amount-display {
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
    padding: var(--spacing-xl);
    border-radius: var(--radius-md);
    text-align: center;
    color: var(--white);
}

.payment-amount-label {
    font-size: 0.9rem;
    margin-bottom: var(--spacing-sm);
    opacity: 0.9;
}

.payment-amount-value {
    font-size: 2rem;
    font-weight: 700;
}

.change-display {
    background: var(--success);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    text-align: center;
    color: var(--white);
    font-size: 1.3rem;
    font-weight: 700;
}

/* ============= FILTRES ============= */
.filters-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    box-shadow: var(--shadow);
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-md);
    align-items: end;
}

/* ============= UTILITY CLASSES ============= */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-center { display: flex; justify-content: center; align-items: center; }
.flex-gap { gap: var(--spacing-md); }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--spacing-md); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--spacing-md); }

/* ============= RESPONSIVE ============= */
@media (max-width: 1024px) {
    .pos-container {
        grid-template-columns: 1fr;
    }
    
    .pos-cart {
        max-height: none;
    }
}

@media (max-width: 768px) {
    :root {
        --sidebar-width: 0;
    }
    
    .app-sidebar {
        transform: translateX(-100%);
    }
    
    .app-sidebar:not(.collapsed) {
        transform: translateX(0);
        width: 260px;
        z-index: 1001;
    }
    
    .app-main {
        margin-left: 0 !important;
    }
    
    .app-footer {
        left: 0 !important;
    }
    
    .header-user {
        display: none;
    }
    
    .app-content {
        padding: var(--spacing-md);
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .grid-2, .grid-3 {
        grid-template-columns: 1fr;
    }
}

/* ============= PRINT ============= */
@media print {
    .app-header,
    .app-sidebar,
    .app-footer,
    .btn,
    .no-print {
        display: none !important;
    }
    
    .app-main {
        margin: 0 !important;
    }
    
    body {
        background: white;
    }
}

/* ============= BOOTSTRAP INTEGRATION ============= */
/* Améliorer l'intégration avec Bootstrap */
.card {
    background: var(--white);
    border: none;
    box-shadow: var(--shadow);
}

.page-header {
    background: var(--white);
    padding: 0.85rem 1rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: var(--spacing-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
}

.page-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--dark);
    margin: 0;
}

.page-subtitle {
    font-size: 0.8rem;
    color: var(--gray);
    margin: 0;
}

/* Améliorer les tables Bootstrap dans notre contexte */
.table-responsive {
    border-radius: var(--radius);
    overflow: hidden;
}

.table {
    margin-bottom: 0;
}

.table thead th {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.3px;
    padding: 0.5rem 0.75rem;
}

/* Améliorer les modals Bootstrap */
.modal-content {
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
}

.modal-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white);
    border-bottom: none;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    padding: 0.85rem 1rem;
}

.modal-header .modal-title {
    font-weight: 600;
}

.modal-header .btn-close {
    filter: brightness(0) invert(1);
    opacity: 0.8;
}

.modal-header .btn-close:hover {
    opacity: 1;
}

.modal-body {
    padding: 1rem;
}

.modal-footer {
    border-top: 1px solid var(--gray-light);
    padding: 0.75rem 1rem;
}

/* Améliorer les badges Bootstrap */
.badge {
    padding: 0.2em 0.6em;
    font-weight: 500;
    font-size: 0.72rem;
}

/* Améliorer les boutons dans notre contexte */
.btn-group .btn {
    margin: 0;
}

/* Formulaires Bootstrap dans notre design */
.form-label {
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 0.5rem;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.25rem rgba(99, 102, 241, 0.15);
}

/* Alertes */
.alert {
    border: none;
    border-radius: var(--radius);
    padding: 0.65rem 0.85rem;
    margin-bottom: var(--spacing-md);
    font-size: 0.85rem;
}

/* Améliorer les cartes dans le contexte Bootstrap */
.app-content .card {
    padding: 1rem;
    margin-bottom: var(--spacing-md);
}

/* Optimiser la densité des formulaires Bootstrap */
.form-label {
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 0.35rem;
    font-size: 0.8rem;
}

.form-control, .form-select {
    padding: 0.4rem 0.65rem;
    font-size: 0.85rem;
    line-height: 1.4;
}

.form-text {
    font-size: 0.72rem;
    margin-top: 0.2rem;
}

/* Réduire les marges Bootstrap */
.mb-3 {
    margin-bottom: 0.75rem !important;
}

.mb-4 {
    margin-bottom: 1rem !important;
}

.mt-4 {
    margin-top: 1rem !important;
}

.row {
    margin-left: -0.5rem;
    margin-right: -0.5rem;
}

.row > * {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

.g-3 {
    gap: 0.75rem !important;
}

/* Optimiser les boutons Bootstrap */
.btn-sm {
    padding: 0.3rem 0.6rem;
    font-size: 0.75rem;
}

.btn-lg {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

/* Améliorer les card-body Bootstrap */
.card-body {
    padding: 0.85rem;
}

.card-header {
    padding: 0.65rem 0.85rem;
    font-size: 0.9rem;
}

/* Optimiser les tableaux Bootstrap */
.table > :not(caption) > * > * {
    padding: 0.5rem 0.65rem;
}

.table-sm > :not(caption) > * > * {
    padding: 0.35rem 0.5rem;
}

/* Responsive pour les modals */
@media (max-width: 576px) {
    .modal-dialog {
        margin: 0.5rem;
    }
    
    .modal-body {
        padding: 0.85rem;
    }
}
