/**
 * Styles principaux - Design moderne inspiré d'Envato
 */

/* Variables CSS - Style Envato Elements */
:root {
    /* Couleurs principales - Palette Envato Elements */
    --primary: #82B440;
    --primary-dark: #6a9535;
    --primary-light: #9BC658;
    --primary-hover: #7aa03a;
    --secondary: #303030;
    --secondary-dark: #1a1a1a;
    --success: #82B440;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    
    /* Couleurs neutres Envato */
    --dark: #303030;
    --dark-light: #484848;
    --gray: #666666;
    --gray-light: #e5e5e5;
    --light: #fafafa;
    --white: #ffffff;
    --bg-main: #fafafa;
    --text-main: #303030;
    --text-secondary: #666666;
    
    /* Gradients Envato */
    --gradient-primary: var(--primary);
    --gradient-success: var(--success);
    --gradient-danger: var(--danger);
    --gradient-info: var(--info);
    --gradient-dark: var(--dark);
    
    /* Ombres */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    
    /* Rayons de bordure */
    --radius-sm: 0.375rem;
    --radius: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;

    /* Tailles des miniatures produits */
    --product-thumb-size: 80px;
    --product-thumb-size-list: 40px;
    --rental-thumb-size: 80px;
    
    /* Transitions */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset et base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'Segoe UI', 'Roboto', 'Arial', sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-main);
    background-color: var(--bg-main);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.app-loader {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
}

.app-loader.active {
    opacity: 1;
    pointer-events: all;
}

.app-loader.fade-out {
    opacity: 0;
    pointer-events: none;
}

.app-loader-card {
    background: transparent;
    border-radius: 12px;
    padding: 1.5rem 2rem;
    min-width: 260px;
    text-align: center;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.app-loader-card img {
    max-width: 160px;
    height: auto;
    margin: 0 auto;
    display: block;
}

.app-loader-text {
    font-size: 0.95rem;
    font-weight: 600;
    color: #ffffff;
    letter-spacing: 0.02em;
}

.page-footer-logo {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    gap: 0.35rem;
    padding: 1.5rem 0 0.5rem;
}

.page-footer-logo img {
    max-width: 140px;
    height: auto;
    opacity: 0.85;
    display: block;
}

.page-footer-contact {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    text-decoration: none;
}

.page-footer-contact:hover {
    color: var(--text-main);
}

/* SVG Icons */
.icon {
    width: 1em;
    height: 1em;
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
}

.nav-link .icon {
    width: 1.25rem;
    height: 1.25rem;
}

.icon-large {
    width: 2rem;
    height: 2rem;
}

.icon-lg {
    width: 3rem;
    height: 3rem;
}

.icon-sm {
    width: 1rem;
    height: 1rem;
}

.icon-xs {
    width: 0.75rem;
    height: 0.75rem;
}

.icon-empty {
    width: 3rem;
    height: 3rem;
    opacity: 0.3;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: var(--dark);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

p {
    margin-bottom: 1rem;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

/* Layout */
.wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: var(--white);
    box-shadow: var(--shadow-md);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
    transition: var(--transition);
}

.sidebar-logo {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(0,0,0,0.1);
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-logo img {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 80px;
    object-fit: contain;
    background: #ffffff;
    padding: 15px;
    border-radius: 4px;
    display: block;
    margin: 0 auto;
}

.sidebar-nav {
    padding: 1rem 0;
}

.nav-item {
    margin: 0.25rem 0;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 0.875rem 1.5rem;
    color: var(--dark-light);
    font-weight: 500;
    transition: var(--transition);
    gap: 0.75rem;
}

.nav-link i {
    font-size: 1.25rem;
    width: 24px;
    text-align: center;
}

.nav-link:hover {
    background-color: var(--light);
    color: var(--primary);
}

.nav-link.active {
    background: var(--light);
    color: var(--primary);
    border-left: 3px solid var(--primary);
}

.nav-section {
    padding: 1rem 1.5rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray);
}

/* Main content */
.main-content {
    flex: 1;
    margin-left: 280px;
    min-height: 100vh;
}

/* Header */
.header {
    background: var(--white);
    box-shadow: var(--shadow);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-title h1 {
    margin: 0;
    font-size: 1.75rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    background: var(--light);
    border-radius: var(--radius-lg);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gradient-primary);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-weight: 700;
    font-size: 1.125rem;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
    display: block;
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--dark);
}

.user-role {
    font-size: 0.8125rem;
    color: var(--gray);
    text-transform: capitalize;
}

/* Content */
.content {
    padding: 2rem;
}

/* Cards */
.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--light);
}

.card-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
    color: var(--dark);
}

.card-body {
    padding: 0;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--primary);
}

.stat-card.success::before { background: var(--primary); }
.stat-card.danger::before { background: var(--danger); }
.stat-card.info::before { background: var(--info); }
.stat-card.warning::before { background: var(--warning); }

.stat-card:hover {
    box-shadow: var(--shadow);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    margin-bottom: 1rem;
    background: var(--primary);
    color: var(--white);
}

.stat-icon .icon,
.stat-icon svg {
    width: 32px !important;
    height: 32px !important;
    color: var(--white) !important;
    stroke: var(--white) !important;
    fill: none !important;
}

.stat-icon svg {
    display: block;
}

.stat-card.success .stat-icon { background: var(--primary); }
.stat-card.danger .stat-icon { background: var(--danger); }
.stat-card.info .stat-icon { background: var(--info); }
.stat-card.warning .stat-icon { background: var(--warning); }

.stat-icon svg,
.stat-icon .icon {
    width: 32px !important;
    height: 32px !important;
    display: block;
}

.stat-icon svg {
    stroke: var(--white) !important;
    fill: none !important;
    color: var(--white) !important;
}

.stat-icon svg * {
    stroke: inherit !important;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--dark);
    line-height: 1;
}

.stat-change {
    margin-top: 0.75rem;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.stat-change.positive {
    color: var(--success);
}

.stat-change.negative {
    color: var(--danger);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 0.9375rem;
    font-weight: 600;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    line-height: 1;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
    border-radius: 4px;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
}

.btn-success {
    background: var(--primary);
    color: var(--white);
    border-radius: 4px;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.btn-success:hover:not(:disabled) {
    background: var(--primary-hover);
}

.btn-info {
    background: var(--gradient-info);
    color: var(--white);
    box-shadow: 0 4px 12px rgba(59,130,246,0.25);
}

.btn-info:hover:not(:disabled) {
    background: #2563eb;
}

.btn-warning {
    background: var(--warning);
    color: var(--white);
    box-shadow: 0 4px 12px rgba(245,158,11,0.25);
}

.btn-warning:hover:not(:disabled) {
    background: #d97706;
}

.btn-danger {
    background: var(--gradient-danger);
    color: var(--white);
    box-shadow: 0 4px 12px rgba(239,68,68,0.3);
}

.btn-danger:hover:not(:disabled) {
    background: #dc2626;
}

.btn-secondary {
    background: var(--light);
    color: var(--dark);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--gray-light);
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-icon {
    padding: 0.75rem;
    width: 40px;
    height: 40px;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--dark);
    font-size: 0.9375rem;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.9375rem;
    border: 2px solid var(--gray-light);
    border-radius: var(--radius);
    transition: var(--transition);
    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::placeholder {
    color: var(--gray);
}

select.form-control {
    cursor: pointer;
    appearance: auto;
    -webkit-appearance: auto;
    -moz-appearance: auto;
    background-image: none;
    padding-right: 1rem;
}

/* Table */
.table-responsive {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.table {
    width: 100%;
    background: var(--white);
    border-collapse: collapse;
}

.table thead {
    background: var(--light);
}

.table th {
    padding: 1rem;
    text-align: left;
    font-weight: 700;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray);
    border-bottom: 2px solid var(--gray-light);
}

.table td {
    padding: 1rem;
    border-bottom: 1px solid var(--light);
    color: var(--dark-light);
}

.table tbody tr {
    transition: var(--transition);
}

.table tbody tr:hover {
    background: #fafafa;
}

/* Invoice QR */
.invoice-qr-layout {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.invoice-qr-preview {
    width: 180px;
    height: 180px;
    background: var(--light);
    border: 1px dashed var(--gray-light);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
}

.invoice-qr-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.invoice-qr-placeholder {
    font-size: 0.85rem;
    color: var(--gray);
    text-align: center;
}

.invoice-qr-meta {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    min-width: 220px;
}

.invoice-qr-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.invoice-qr-expiry {
    font-size: 0.8rem;
    color: var(--gray);
}

/* Mixed payments */
.mixed-payment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.mixed-payment-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-size: 0.85rem;
    color: var(--gray);
}

.mixed-payment-summary {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    font-size: 0.9rem;
    color: var(--dark);
    flex-wrap: wrap;
}

/* Quick search results */
.search-result-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.search-result-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.search-result-text {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}

.search-result-title {
    font-weight: 600;
    color: var(--dark);
}

.search-result-meta {
    font-size: 0.8rem;
    color: var(--gray);
}

.search-result-price {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--primary);
    white-space: nowrap;
}

.search-thumb {
    width: 36px;
    height: 36px;
    border-radius: var(--radius);
    background: var(--light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray);
    font-weight: 700;
    font-size: 0.75rem;
    flex-shrink: 0;
    object-fit: cover;
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.pagination-info {
    font-size: 0.85rem;
    color: var(--gray);
}

.pagination-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.pagination-page {
    font-weight: 600;
    color: var(--dark);
}

.btn.disabled,
.btn[aria-disabled="true"] {
    opacity: 0.55;
    pointer-events: none;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
    font-weight: 600;
    border-radius: var(--radius);
    line-height: 1;
}

.badge-primary {
    background: rgba(99,102,241,0.1);
    color: var(--primary);
}

.badge-success {
    background: rgba(16,185,129,0.1);
    color: var(--success);
}

.badge-danger {
    background: rgba(239,68,68,0.1);
    color: var(--danger);
}

.badge-warning {
    background: rgba(245,158,11,0.1);
    color: var(--warning);
}

.badge-info {
    background: rgba(59,130,246,0.1);
    color: var(--info);
}

/* Alerts */
.alert {
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
}

.alert i {
    font-size: 1.25rem;
}

.alert-success {
    background: rgba(16,185,129,0.1);
    color: var(--success);
    border-left: 4px solid var(--success);
}

.alert-danger {
    background: rgba(239,68,68,0.1);
    color: var(--danger);
    border-left: 4px solid var(--danger);
}

.alert-warning {
    background: rgba(245,158,11,0.1);
    color: var(--warning);
    border-left: 4px solid var(--warning);
}

.alert-info {
    background: rgba(59,130,246,0.1);
    color: var(--info);
    border-left: 4px solid var(--info);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--gray-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--gray);
    transition: var(--transition);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.modal-close:hover {
    background: var(--light);
    color: var(--dark);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--gray-light);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Global reveal animations */
body {
    animation: fadeIn 0.25s ease;
}

.reveal {
    animation: slideUp 0.45s ease both;
}

.card,
.stat-card,
.product-card,
.table-responsive {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover,
.stat-card:hover,
.product-card:hover,
.table-responsive:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}

/* Loading */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: var(--white);
    animation: spin 0.8s linear infinite;
}

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

/* Utilities */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--gray); }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

.d-flex { display: flex; }
.align-items-center { align-items: center; }
.justify-content-between { justify-content: space-between; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }

/* Responsive */
/* Cacher le bouton menu-toggle sur les grands écrans */
#menu-toggle {
    display: none;
}

@media (max-width: 768px) {
    /* Afficher le bouton menu-toggle sur les petits écrans */
    #menu-toggle {
        display: inline-flex;
    }
    
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .content {
        padding: 1rem;
    }
}

/* Print Styles */
@media print {
    .sidebar,
    .header,
    .btn,
    .no-print {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}


/* Compact theme */
body {
    font-family: "IBM Plex Sans", "Segoe UI", Tahoma, sans-serif;
    --primary: #2f6f4e;
    --primary-dark: #24583e;
    --primary-light: #4c8a67;
    --primary-hover: #2a6346;
    --secondary: #2b2b2b;
    --secondary-dark: #1c1c1c;
    --success: #2f6f4e;
    --warning: #d97706;
    --danger: #dc2626;
    --info: #2563eb;

    --dark: #1f2328;
    --dark-light: #374151;
    --gray: #5c6168;
    --gray-light: #e1e5e9;
    --light: #f3f5f7;
    --white: #ffffff;
    --bg-main: #f6f7f8;
    --text-main: #1f2328;
    --text-secondary: #5c6168;

    --gradient-primary: var(--primary);
    --gradient-success: var(--success);
    --gradient-danger: var(--danger);
    --gradient-info: var(--info);
    --gradient-dark: var(--dark);

    --shadow-sm: 0 1px 0 rgba(16, 24, 40, 0.03);
    --shadow: 0 1px 2px rgba(16, 24, 40, 0.06);
    --shadow-md: 0 2px 6px rgba(16, 24, 40, 0.08);
    --shadow-lg: 0 4px 10px rgba(16, 24, 40, 0.1);
    --shadow-xl: 0 8px 18px rgba(16, 24, 40, 0.12);

    --radius-sm: 4px;
    --radius: 6px;
    --radius-md: 8px;
    --radius-lg: 10px;
    --radius-xl: 12px;
}

body .sidebar {
    width: 250px;
    box-shadow: none;
    border-right: 1px solid var(--gray-light);
    background: var(--white);
}

body .main-content {
    margin-left: 250px;
}

body .sidebar-logo {
    padding: 1rem;
    border-bottom: 1px solid var(--gray-light);
}

body .sidebar-logo img {
    padding: 8px;
    border-radius: 6px;
    background: transparent;
}

body .nav-link {
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
    gap: 0.5rem;
}

body .nav-link i {
    font-size: 1rem;
    width: 18px;
}

body .nav-link.active {
    background: var(--light);
    border-left: 2px solid var(--primary);
}

body .nav-section {
    padding: 0.75rem 1rem 0.4rem;
    font-size: 0.68rem;
    letter-spacing: 0.06em;
}

body .header {
    box-shadow: none;
    border-bottom: 1px solid var(--gray-light);
    padding: 0.75rem 1.5rem;
}

body .header-title h1 {
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--dark);
    background: none;
    -webkit-text-fill-color: currentColor;
}

body .header-actions {
    gap: 0.5rem;
}

body .user-info {
    background: transparent;
    border: 1px solid var(--gray-light);
    border-radius: 6px;
    padding: 0.35rem 0.6rem;
}

body .user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: var(--primary);
    font-size: 0.9rem;
}

body .user-avatar.user-avatar-lg {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    font-size: 2rem;
}

body .user-role {
    font-size: 0.75rem;
}

body .content {
    padding: 1.25rem;
}

body .card {
    padding: 1rem;
    border: 1px solid var(--gray-light);
    box-shadow: none;
}

body .card-header {
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--gray-light);
}

body .card-title {
    font-size: 1.05rem;
}

body .stats-grid {
    gap: 1rem;
    margin-bottom: 1.25rem;
}

body .stat-card {
    padding: 1rem;
    border: 1px solid var(--gray-light);
    box-shadow: none;
}

body .stat-card::before {
    height: 3px;
}

body .stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 6px;
    font-size: 1.1rem;
}

body .btn {
    padding: 0.5rem 0.9rem;
    font-size: 0.9rem;
    border-radius: 6px;
}

body .btn-primary,
body .btn-success,
body .btn-info,
body .btn-warning,
body .btn-danger {
    box-shadow: none;
}

body .btn-info {
    background: var(--info);
}

body .btn-warning {
    background: var(--warning);
}

body .btn-danger {
    background: var(--danger);
}

body .btn-secondary {
    background: var(--light);
    border: 1px solid var(--gray-light);
}

body .btn-lg {
    padding: 0.6rem 1.1rem;
    font-size: 0.95rem;
}

body .btn-sm {
    padding: 0.35rem 0.6rem;
    font-size: 0.8rem;
}

body .btn-icon {
    width: 34px;
    height: 34px;
    padding: 0.4rem;
}

body .form-group {
    margin-bottom: 1rem;
}

body .form-label {
    font-size: 0.85rem;
}

body .form-control {
    padding: 0.55rem 0.75rem;
    border: 1px solid var(--gray-light);
    border-radius: 6px;
}

body .form-control:focus {
    box-shadow: none;
    border-color: var(--primary);
}

body .table-responsive {
    border: 1px solid var(--gray-light);
    border-radius: 8px;
    box-shadow: none;
}

body .table th {
    padding: 0.7rem 0.75rem;
    font-size: 0.72rem;
}

body .table td {
    padding: 0.7rem 0.75rem;
}

body .table thead {
    background: #f1f3f5;
}

body .table tbody tr:hover {
    background: #f6f7f8;
}

body .badge {
    border-radius: 999px;
    padding: 0.2rem 0.6rem;
    font-weight: 600;
    font-size: 0.72rem;
}

/* Admin products filters */
body .admin-products-filter {
    border: 2px solid rgba(59,130,246,0.35);
    background: linear-gradient(135deg, #f8fafc, #eef2ff);
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--dark);
    box-shadow: 0 6px 14px rgba(59,130,246,0.15);
}

body .admin-products-filter:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59,130,246,0.2);
}

.admin-products-count.badge {
    padding: 0.35rem 0.85rem;
    font-size: 0.85rem;
    font-weight: 700;
    border-radius: 999px;
    letter-spacing: 0.02em;
}

.admin-products-count--total {
    background: rgba(59,130,246,0.15);
    color: var(--primary);
    border: 1px solid rgba(59,130,246,0.25);
}

.admin-products-count--filter {
    background: rgba(16,185,129,0.18);
    color: var(--success);
    border: 1px solid rgba(16,185,129,0.28);
}

.admin-products-count-value {
    margin-left: 0.35rem;
    font-size: 1.05rem;
    font-weight: 800;
}
/* Compact theme responsive */
@media (max-width: 1024px) {
    body .main-content {
        margin-left: 0;
    }
}
/* Admin products image carousel */
#products-cards .product-card-image,
#products-list .product-card-image {
    position: relative;
    overflow: hidden;
    background: var(--light);
    display: flex;
    align-items: center;
    justify-content: center;
}

#products-cards .product-card-image {
    height: 160px;
}

#products-list .product-card-image {
    width: 50px;
    height: 50px;
    border-radius: var(--radius);
}

#products-cards .product-card-image img {
    width: var(--product-thumb-size);
    height: var(--product-thumb-size);
    object-fit: contain;
    display: block;
}

#products-list .product-card-image img {
    width: var(--product-thumb-size-list);
    height: var(--product-thumb-size-list);
    object-fit: contain;
    display: block;
}

#products-cards .product-card-image-empty,
#products-list .product-card-image-empty {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray);
}

/* Vendeur: miniatures produits */
.product-thumb-wrap {
    position: relative;
    height: 110px;
    background: var(--light);
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-thumb {
    width: var(--product-thumb-size);
    height: var(--product-thumb-size);
    object-fit: contain;
    display: block;
}

#products-cards .image-nav,
#products-list .image-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: rgba(0, 0, 0, 0.45);
    color: #ffffff;
    border-radius: 999px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
}

#products-list .image-nav {
    width: 18px;
    height: 18px;
    font-size: 10px;
}

#products-cards .image-nav.prev,
#products-list .image-nav.prev {
    left: 6px;
}

#products-cards .image-nav.next,
#products-list .image-nav.next {
    right: 6px;
}

#products-list .image-nav.prev {
    left: 2px;
}

#products-list .image-nav.next {
    right: 2px;
}

/* Rentals module accent */
body.module-rentals {
    --primary: #dc2626;
    --primary-dark: #b91c1c;
    --primary-light: #ef4444;
    --primary-hover: #b91c1c;
    --success: #dc2626;
    --gradient-primary: var(--primary);
    --gradient-success: var(--success);
}

body.module-rentals .rental-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

body.module-rentals .rental-lock-btn {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

body.module-rentals .rental-info-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 1.5rem;
}

body.module-rentals .rental-stock-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

body.module-rentals .rental-item-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 220px));
    gap: 1rem;
    justify-content: start;
}

body.module-rentals .rental-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

body.module-rentals .rental-card-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

body.module-rentals .rental-revenue-strip {
    margin: 0.6rem 0 1.5rem;
    padding: 0.6rem 1rem;
    border: 1px solid var(--light);
    border-radius: var(--radius);
    background: var(--white);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

body.module-rentals .rental-revenue-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

body.module-rentals .rental-revenue-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--dark);
}

body.module-rentals .rental-revenue-filter {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

body.module-rentals .rental-revenue-filter label {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.72rem;
    color: var(--gray);
}

body.module-rentals .rental-revenue-filter input {
    height: 30px;
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
    border: 1px solid var(--light);
    border-radius: 6px;
    background: var(--white);
}

body.module-rentals .rental-revenue-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

body.module-rentals .rental-revenue-card {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding-right: 1rem;
    border-right: 1px solid var(--light);
}

body.module-rentals .rental-revenue-card:last-child {
    padding-right: 0;
    border-right: none;
}

body.module-rentals .rental-revenue-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--gray);
}

body.module-rentals .rental-revenue-value {
    font-weight: 700;
    font-size: 1rem;
    color: var(--dark);
}

body.module-rentals .rental-scroll-actions {
    display: flex;
    gap: 0.35rem;
}

body.module-rentals .rental-item-scroll {
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 0.25rem;
    max-width: 100%;
    width: 100%;
    margin: 0 auto;
}

body.module-rentals .rental-item-track {
    display: flex;
    gap: 1rem;
    width: max-content;
    min-width: 100%;
}

body.module-rentals.rental-dashboard .content {
    max-width: 1400px;
    margin: 0 auto;
}

body.module-rentals .rental-dashboard-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 1.5rem;
}

@media (max-width: 1100px) {
    body.module-rentals .rental-dashboard-grid {
        grid-template-columns: 1fr;
    }
}

body.module-rentals .table tbody tr.rental-row-paid,
body.module-rentals .table tbody tr.rental-row-paid td {
    background-color: #eaf7ea;
}

body.module-rentals .table tbody tr.rental-row-partial,
body.module-rentals .table tbody tr.rental-row-partial td {
    background-color: #e8f1ff;
}

body.module-rentals .table tbody tr.rental-row-unpaid,
body.module-rentals .table tbody tr.rental-row-unpaid td {
    background-color: #fdeaea;
}

body.module-rentals .rental-variant-row {
    cursor: pointer;
}

body.module-rentals .rental-variant-row:hover {
    background-color: #f7f9fc;
}

body.module-rentals .rental-item-track .rental-item-card {
    flex: 0 0 220px;
}

body.module-rentals .rental-item-card {
    border: 1px solid var(--light);
    border-radius: var(--radius);
    background: var(--white);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

body.module-rentals .rental-item-image {
    position: relative;
    height: 140px;
    background: var(--light);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    box-sizing: border-box;
}

body.module-rentals .rental-item-image img {
    width: var(--rental-thumb-size);
    height: var(--rental-thumb-size);
    object-fit: contain;
    display: block;
}

body.module-rentals .rental-item-image-empty {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray);
}

body.module-rentals .rental-image-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: rgba(0, 0, 0, 0.45);
    color: #ffffff;
    border-radius: 999px;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
}

body.module-rentals .rental-image-nav.prev {
    left: 6px;
}

body.module-rentals .rental-image-nav.next {
    right: 6px;
}

body.module-rentals .rental-item-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(17, 24, 39, 0.85);
    color: #ffffff;
    font-size: 0.68rem;
    font-weight: 600;
    padding: 0.15rem 0.4rem;
    border-radius: 999px;
}

body.module-rentals .rental-item-body {
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

body.module-rentals .rental-item-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--dark);
}

body.module-rentals .rental-item-meta {
    display: flex;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 0.35rem 0.9rem;
    font-size: 0.8rem;
    color: var(--gray);
}

body.module-rentals .rental-item-meta-total {
    color: #1d5bd6;
    font-weight: 700;
}

body.module-rentals .rental-item-meta-dispo {
    color: #1a8f3a;
    font-weight: 700;
}

body.module-rentals .rental-item-meta-dehors {
    color: #d02a2a;
    font-weight: 700;
}

body.module-rentals .rental-item-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

body.module-rentals .rental-chart-wrap {
    max-width: 50%;
    margin: 0 auto;
}

@media (max-width: 1024px) {
    body.module-rentals .rental-chart-wrap {
        max-width: 100%;
    }
}

@media (max-width: 820px) {
    body.module-rentals .rental-revenue-header {
        flex-direction: column;
        align-items: flex-start;
    }

    body.module-rentals .rental-revenue-cards {
        grid-template-columns: 1fr;
    }

    body.module-rentals .rental-revenue-card {
        padding-right: 0;
        padding-bottom: 0.5rem;
        border-right: none;
        border-bottom: 1px solid var(--light);
    }

    body.module-rentals .rental-revenue-card:last-child {
        border-bottom: none;
        padding-bottom: 0;
    }
}

body.module-rentals .rental-calendar {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

body.module-rentals .rental-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0.5rem;
}

body.module-rentals .rental-calendar-weekday {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--gray);
    text-align: center;
}

body.module-rentals .rental-calendar-day {
    border: 1px solid var(--light);
    border-radius: var(--radius);
    padding: 0.5rem;
    min-height: 120px;
    background: #ffffff;
    text-align: left;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    width: 100%;
}

body.module-rentals .rental-calendar-day--rental {
    border-color: #dc2626;
    background: rgba(220, 38, 38, 0.08);
}

body.module-rentals .rental-calendar-day--return {
    border-color: #2563eb;
    background: rgba(37, 99, 235, 0.08);
}

body.module-rentals .rental-calendar-day--safe {
    border-color: #16a34a;
    background: rgba(22, 163, 74, 0.08);
}

body.module-rentals .rental-calendar-day--empty {
    background: var(--light);
    border-style: dashed;
    cursor: default;
}

body.module-rentals .rental-calendar-number {
    font-weight: 700;
    font-size: 1rem;
}

body.module-rentals .rental-calendar-meta {
    font-size: 0.75rem;
    color: var(--gray);
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

body.module-rentals .rental-calendar-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.8rem;
    color: var(--gray);
}

body.module-rentals .rental-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    display: inline-block;
    margin-right: 0.35rem;
}

body.module-rentals .rental-images {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.75rem;
}

body.module-rentals .rental-image-card {
    border: 1px solid var(--gray-light);
    border-radius: 8px;
    padding: 0.5rem;
    background: var(--white);
}

body.module-rentals .rental-image-card img {
    width: 100%;
    height: 110px;
    object-fit: cover;
    border-radius: 6px;
    display: block;
}

body.module-rentals .rental-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.75rem;
    align-items: end;
}

body.module-rentals .rental-list {
    list-style: none;
    padding-left: 0;
    margin: 0;
    display: grid;
    gap: 0.5rem;
}

body.module-rentals .rental-list li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

body.module-rentals .rental-list li::before {
    content: '\2022';
    color: var(--primary);
    display: inline-block;
    width: 0.75rem;
}
.out-of-stock {
    border-color: var(--danger) !important;
    box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.12);
}

.out-of-stock-row {
    border: 1px solid var(--danger);
    border-left-width: 4px;
    background: rgba(220, 38, 38, 0.04);
}

.out-of-stock .badge-secondary {
    background: rgba(220, 38, 38, 0.08);
    color: var(--danger);
    border-color: rgba(220, 38, 38, 0.25);
}

.btn-credit {
    background: #fff7ed;
    border: 1px solid #fb923c;
    color: #c2410c;
}

.btn-credit:hover {
    background: #ffedd5;
    border-color: #f97316;
    color: #9a3412;
}

.btn-credit:active {
    background: #fed7aa;
}
