:root {
    --primary: #5D7B3E;
    --primary-dark: #4A6530;
    --primary-light: #8BA66B;
    --accent: #2C4A2E;
    --bg: #FAFBF7;
    --bg-secondary: #F5F7F2;
    --white: #FFFFFF;
    --text: #333333;
    --text-light: #666666;
    --text-lighter: #999999;
    --border: #E0E0E0;
    --border-light: #EEEEEE;
    --danger: #C0392B;
    --danger-light: #E74C3C;
    --warning: #F39C12;
    --warning-light: #F1C40F;
    --success: #27AE60;
    --success-light: #2ECC71;
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-lg: 0 4px 20px rgba(0,0,0,0.12);
    --radius: 8px;
    --radius-sm: 4px;
    --radius-lg: 12px;
    --transition: all 0.2s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
    line-height: 1.5;
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--white);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 100;
    transition: var(--transition);
}

.sidebar .logo {
    padding: 24px 20px;
    border-bottom: 1px solid var(--border-light);
}

.sidebar .logo h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: -0.5px;
}

.sidebar .logo span {
    font-size: 14px;
    color: var(--text-light);
    font-weight: 400;
}

.sidebar nav {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-light);
    text-decoration: none;
    border-radius: var(--radius);
    margin-bottom: 4px;
    transition: var(--transition);
    font-weight: 500;
}

.nav-item svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.nav-item:hover {
    background: var(--bg-secondary);
    color: var(--primary);
}

.nav-item.active {
    background: var(--primary);
    color: var(--white);
}

.nav-divider {
    height: 1px;
    background: var(--border-light);
    margin: 12px 0;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 260px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.header {
    background: var(--white);
    padding: 16px 32px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50;
}

.header h2 {
    font-size: 22px;
    font-weight: 600;
    color: var(--text);
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: var(--text);
}

.menu-toggle svg {
    width: 24px;
    height: 24px;
}

.header-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.content {
    flex: 1;
    padding: 24px 32px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
}

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

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--border-light);
}

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

.btn-danger:hover {
    background: #A93226;
}

.btn-success {
    background: var(--success);
    color: var(--white);
}

.btn-success:hover {
    background: #229954;
}

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

.btn-warning:hover {
    background: #D68910;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.btn-icon {
    padding: 8px;
    border-radius: var(--radius-sm);
}

.btn svg {
    width: 16px;
    height: 16px;
}

/* Cards */
.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 24px;
    margin-bottom: 20px;
}

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

.card-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon.green {
    background: rgba(93, 123, 62, 0.1);
    color: var(--primary);
}

.stat-icon.orange {
    background: rgba(243, 156, 18, 0.1);
    color: var(--warning);
}

.stat-icon.red {
    background: rgba(192, 57, 43, 0.1);
    color: var(--danger);
}

.stat-icon.blue {
    background: rgba(52, 152, 219, 0.1);
    color: #3498DB;
}

.stat-icon svg {
    width: 24px;
    height: 24px;
}

.stat-content h3 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text);
    line-height: 1;
}

.stat-content p {
    font-size: 14px;
    color: var(--text-light);
    margin-top: 4px;
}

/* Tables */
.table-container {
    overflow-x: auto;
}

#commandesTableContainer {
    max-height: none;
    overflow-y: visible;
    height: auto;
}

#archivesTableContainer {
    max-height: none;
    overflow-y: visible;
}

.actions-cell {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
}

th {
    font-weight: 600;
    color: var(--text-light);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--bg-secondary);
}

tr:hover td {
    background: var(--bg-secondary);
}

.table-actions {
    display: flex;
    gap: 8px;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 6px;
}

input, select, textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 14px;
    color: var(--text);
    background: var(--white);
    transition: var(--transition);
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(93, 123, 62, 0.1);
}

input[type="checkbox"] {
    width: auto;
    margin-right: 8px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--white);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: translateY(20px);
    transition: var(--transition);
}

.modal-overlay.active .modal {
    transform: translateY(0);
}

.modal-large,
.modal-container.modal-large .modal {
    max-width: 900px;
    width: 95%;
}

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

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-light);
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}

.modal-close:hover {
    color: var(--text);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

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

/* Toast */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast {
    background: var(--white);
    padding: 14px 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 280px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast.success {
    border-left: 4px solid var(--success);
}

.toast.error {
    border-left: 4px solid var(--danger);
}

.toast.warning {
    border-left: 4px solid var(--warning);
}

/* Filters */
.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: var(--radius);
}

.filters select, .filters input {
    max-width: 200px;
}

/* Status Badges */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.badge-success {
    background: rgba(39, 174, 96, 0.1);
    color: var(--success);
}

.badge-warning {
    background: rgba(243, 156, 18, 0.1);
    color: var(--warning);
}

.badge-danger {
    background: rgba(192, 57, 43, 0.1);
    color: var(--danger);
}

.badge-info {
    background: rgba(52, 152, 219, 0.1);
    color: #3498DB;
}

.badge-default {
    background: var(--bg-secondary);
    color: var(--text-light);
}

/* Status dropdown */
.status-cell {
    position: relative;
}

.status-badge {
    cursor: pointer;
    user-select: none;
}

.status-badge:hover {
    opacity: 0.8;
}

.status-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    z-index: 100;
    min-width: 120px;
    overflow: hidden;
}

.status-dropdown.active {
    display: block;
}

.status-option {
    padding: 8px 12px;
    cursor: pointer;
    font-size: 13px;
    white-space: nowrap;
}

.status-option:hover {
    background: var(--bg-secondary);
}

/* Commande details modal */
.commande-details {
    padding: 10px 0;
}

.commande-details p {
    margin-bottom: 8px;
    font-size: 14px;
}

.details-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
}

.details-table th,
.details-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
}

.details-table th {
    background: var(--bg-secondary);
    font-weight: 600;
}

/* Color dots */
.color-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 8px;
}

/* Pointage specific */
.pointage-clock {
    text-align: center;
    padding: 40px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    border-radius: var(--radius-lg);
    color: var(--white);
    margin-bottom: 24px;
}

.current-time {
    font-size: 56px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.current-date {
    font-size: 18px;
    opacity: 0.9;
    margin-top: 8px;
}

.pointage-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-top: 24px;
}

.pointage-employee-select {
    max-width: 300px;
    margin: 0 auto 24px;
}

/* Inventaire */
.inventaire-section {
    margin-bottom: 24px;
}

.inventaire-section h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-light);
}

.inventaire-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding: 8px 0;
}

.inventaire-section-header h4 {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.inventaire-toggle {
    font-size: 12px;
    color: var(--text-light);
    transition: transform 0.2s ease;
}

.inventaire-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 12px;
}

.inventaire-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    border: 1px solid transparent;
}

.inventaire-item.alerte {
    border-color: var(--warning);
    background: var(--warning-light, #FFF3CD);
}

.inventaire-item-name {
    flex: 1;
    font-weight: 500;
}

.inventaire-qty-controls {
    display: flex;
    align-items: center;
    gap: 6px;
}

.inventaire-qty-controls .btn {
    width: 28px;
    height: 28px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: bold;
}

.inventaire-qty {
    min-width: 60px;
    text-align: center;
    font-weight: 600;
    font-size: 14px;
}

.inventaire-item-actions {
    display: flex;
    gap: 4px;
}

.inventaire-item-actions .btn {
    width: 28px;
    height: 28px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.inventaire-alerte-text {
    font-size: 11px;
    color: var(--warning);
    margin-top: -8px;
    margin-bottom: 8px;
    padding-left: 12px;
}

.collapse-content {
    display: none;
}

.collapse-content.open {
    display: block;
}

/* Production planner */
.production-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.production-item {
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    margin-bottom: 12px;
}

.production-item h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ingredient-list {
    list-style: none;
}

.ingredient-list li {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-light);
}

.ingredient-list li:last-child {
    border-bottom: none;
}

/* Cuves production */
.cuve-arome {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-light);
}

.cuve-arome:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.cuve-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    margin-bottom: 12px;
}

.cuve-detail {
    margin-left: 28px;
    margin-bottom: 12px;
    padding: 12px;
    background: var(--white);
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
}

.cuve-detail:last-child {
    margin-bottom: 0;
}

.cuve-title {
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--primary);
    font-size: 13px;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 20px;
}

.tab {
    padding: 12px 20px;
    background: none;
    border: none;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-light);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: var(--transition);
}

.tab:hover {
    color: var(--primary);
}

.tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* Settings */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 24px;
}

.settings-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.settings-card-header {
    padding: 16px 20px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.settings-card-header h3 {
    font-size: 16px;
    font-weight: 600;
}

.settings-list {
    list-style: none;
}

.settings-item {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.settings-item:last-child {
    border-bottom: none;
}

.settings-item-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.settings-item-actions {
    display: flex;
    gap: 8px;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
}

.empty-state svg {
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text);
}

.form-group-btn-end {
    display: flex;
    align-items: flex-end;
}

/* Responsive */
@media (max-width: 1024px) {
    .settings-grid {
        grid-template-columns: 1fr;
    }
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 20px;
}

.sidebar .logo {
    padding: 0;
}

.sidebar-close {
    display: none;
}


/* Sellable Summary */
.sellable-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.sellable-item {
    background: var(--bg-secondary);
    border-radius: var(--radius);
    padding: 16px;
    border: 1px solid var(--border-light);
}

.sellable-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-light);
}

.sellable-header strong {
    flex: 1;
}

.sellable-formats {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 14px;
    color: var(--text-light);
}

.sellable-formats strong {
    color: var(--primary);
}

/* Table Actions */
.table-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
}

/* Bar Chart */
.bar-chart {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.bar-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.bar-label {
    min-width: 120px;
    font-size: 14px;
    color: var(--text);
}

.bar-container {
    flex: 1;
    height: 24px;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    overflow: hidden;
}

.bar {
    height: 100%;
    border-radius: var(--radius);
    transition: width 0.3s ease;
}

.bar-value {
    min-width: 50px;
    text-align: right;
    font-weight: 600;
    color: var(--primary);
}

/* Utility */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-light); }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-2 { gap: 8px; }
.gap-4 { gap: 16px; }

/* ============================================
   COMPREHENSIVE MOBILE STYLES (max-width: 768px)
   ============================================ */
@media (max-width: 768px) {
    /* Base mobile resets */
    body {
        font-size: 14px;
        overflow-x: hidden;
    }

    .content {
        padding: 10px;
        max-width: 100%;
        overflow-x: hidden;
    }

    /* Sidebar - hidden by default, slides in */
    .sidebar {
        transform: translateX(-100%);
        box-shadow: none;
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: 4px 0 16px rgba(0,0,0,0.2);
    }

    .sidebar-close {
        display: flex;
        align-items: center;
        justify-content: center;
        background: none;
        border: none;
        cursor: pointer;
        color: var(--text-light);
        width: 36px;
        height: 36px;
    }

    .sidebar-close svg {
        width: 20px;
        height: 20px;
    }

    .main-content {
        margin-left: 0;
        overflow-x: hidden;
    }

    .menu-toggle {
        display: flex;
    }

    /* Sidebar backdrop overlay */
    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.35);
        z-index: 99;
    }

    .sidebar-overlay.active {
        display: block;
    }

    /* Header */
    .header {
        padding: 10px 12px;
        flex-wrap: wrap;
        gap: 8px;
    }

    .header h2 {
        font-size: 16px;
        flex: 1;
    }

    .header-actions {
        display: flex;
        align-items: center;
        gap: 8px;
    }
    
    /* Cards */
    .card {
        padding: 12px;
        margin-bottom: 12px;
        border-radius: 6px;
    }
    
    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .card-title {
        font-size: 16px;
    }
    
    /* Tables - horizontal scroll with sticky first column */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin-left: -12px;
        margin-right: -12px;
        padding-left: 12px;
        padding-right: 12px;
        max-width: 100vw;
    }
    
    table {
        font-size: 13px;
        min-width: 500px;
        width: 100%;
        max-width: 100%;
    }
    
    th, td {
        padding: 8px 6px;
        white-space: nowrap;
    }
    
    /* Filters - stack vertically */
    .filters {
        flex-direction: column;
        gap: 8px;
        width: 100%;
    }
    
    .filters > * {
        width: 100%;
    }
    
    .filters select, 
    .filters input {
        width: 100%;
        padding: 8px 10px;
        font-size: 13px;
    }
    
    /* Form elements */
    .form-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .form-group {
        margin-bottom: 12px;
    }
    
    .form-group label {
        display: block;
        margin-bottom: 4px;
        font-size: 12px;
        font-weight: 500;
    }
    
    input, select, textarea {
        padding: 8px 10px;
        font-size: 16px;
        width: 100%;
    }
    
    /* Buttons - min 44px touch targets */
    .btn {
        padding: 12px 16px;
        font-size: 13px;
        width: auto;
        min-height: 44px;
    }

    .btn-sm {
        padding: 8px 12px;
        font-size: 12px;
        min-height: 36px;
    }
    
    .btn-block {
        width: 100%;
    }
    
    /* Modal - full width on mobile */
    .modal-overlay {
        padding: 0;
    }
    
    .modal {
        width: 100%;
        max-width: 100%;
        height: 100%;
        max-height: 100%;
        margin: 0;
        border-radius: 0;
    }
    
    .modal-header {
        padding: 12px 16px;
        position: sticky;
        top: 0;
        background: var(--white);
        z-index: 10;
    }
    
    .modal-body {
        padding: 12px;
        overflow-y: auto;
    }
    
    .modal-footer {
        padding: 12px 16px;
        position: sticky;
        bottom: 0;
        background: var(--white);
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .modal-footer .btn {
        flex: 1;
        min-width: 100px;
    }
    
    /* Settings page */
    .settings-grid {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .settings-card {
        margin-bottom: 16px;
        padding: 12px;
    }
    
    .settings-card-header {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .settings-card-header h3 {
        margin: 0;
    }
    
    .settings-card-header > div {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
    }
    
    .settings-card-header .btn {
        flex: 1 1 calc(50% - 4px);
        font-size: 12px;
        padding: 8px 6px;
        text-align: center;
    }
    
    .settings-list {
        max-height: none;
        overflow: visible;
    }
    
    .settings-item {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 10px 0;
        border-bottom: 1px solid var(--border-light);
        gap: 8px;
    }
    
    .settings-item-info {
        flex: 1;
        min-width: 0;
    }
    
    .settings-item-info > div {
        font-size: 12px;
        word-break: break-word;
    }
    
    .settings-item-actions {
        display: flex;
        gap: 6px;
        flex-shrink: 0;
    }
    
    .settings-item-actions .btn {
        padding: 6px 8px;
        font-size: 11px;
    }
    
    /* Pointage clock */
    .pointage-clock {
        padding: 20px 12px;
    }
    
    .current-time {
        font-size: 32px;
    }
    
    .pointage-form {
        width: 100%;
    }
    
    .pointage-form .form-row {
        gap: 10px;
    }
    
    .pointage-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .pointage-actions .btn {
        width: 100%;
    }
    
    /* Stats */
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .stat-card {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 12px;
    }
    
    .stat-icon {
        width: 40px;
        height: 40px;
        flex-shrink: 0;
    }
    
    .stat-icon svg {
        width: 20px;
        height: 20px;
    }
    
    .stat-content h3 {
        font-size: 20px;
    }
    
    .stat-content p {
        font-size: 11px;
    }
    
    /* Tabs */
    .tabs {
        display: flex;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        gap: 4px;
        padding-bottom: 4px;
    }
    
    .tab {
        padding: 10px 14px;
        font-size: 13px;
        white-space: nowrap;
    }
    
    /* Production */
    .production-summary {
        grid-template-columns: 1fr;
    }
    
    .production-item {
        padding: 12px;
    }
    
    .production-item h4 {
        font-size: 14px;
    }
    
    /* Sellable grid */
    .sellable-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .sellable-item {
        padding: 12px;
    }
    
    /* Dashboard stats row */
    .stats-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    /* Action buttons in tables */
    .table-actions,
    .actions-cell {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
    }
    
    .table-actions .btn,
    .actions-cell .btn {
        padding: 6px 8px;
        font-size: 11px;
    }
    
    /* Toast notifications */
    .toast-container {
        left: 8px;
        right: 8px;
        bottom: 8px;
    }
    
    .toast {
        width: 100%;
        min-width: auto;
    }
    
    /* Bar chart */
    .bar-chart {
        margin-top: 12px;
    }
    
    .bar-row {
        flex-direction: column;
        gap: 4px;
        margin-bottom: 8px;
    }
    
    .bar-label {
        font-size: 11px;
    }
    
    .bar-container {
        height: 16px;
    }
    
    /* Item row in forms */
    .item-row {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        margin-bottom: 8px;
        padding: 8px;
        background: var(--bg-secondary);
        border-radius: var(--radius-sm);
    }
    
    .item-row input {
        grid-column: 1 / -1;
    }
    
    /* Items matrix table */
    .items-matrix-container {
        overflow-x: auto;
        max-width: 100%;
    }
    
    .items-matrix {
        width: 100%;
        border-collapse: collapse;
        font-size: 13px;
    }
    
    .items-matrix th,
    .items-matrix td {
        padding: 8px;
        text-align: center;
        border: 1px solid var(--border);
    }
    
    .items-matrix th {
        background: var(--bg-secondary);
        font-weight: 600;
    }
    
    .items-matrix td:first-child {
        text-align: left;
        font-weight: 500;
        background: var(--bg-secondary);
    }
    
    .item-qty-input {
        width: 60px;
        min-width: 60px;
        padding: 6px 4px;
        text-align: center;
        font-size: 13px;
    }
    
    /* Badges */
    .badge {
        font-size: 11px;
        padding: 3px 8px;
    }

    /* Inventaire - mobile layout */
    .inventaire-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .inventaire-item {
        flex-wrap: wrap;
        gap: 8px;
        padding: 10px;
    }

    .inventaire-item-name {
        width: 100%;
        margin-bottom: 2px;
    }

    .inventaire-qty-controls {
        flex: 1;
    }

    .inventaire-qty-controls .btn {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }

    .inventaire-item-actions .btn {
        width: 40px;
        height: 40px;
        font-size: 14px;
    }

    /* Nav items - close sidebar on tap */
    .nav-item {
        padding: 14px 16px;
        min-height: 44px;
    }

    /* Inventaire */
    .inventaire-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .inventaire-item {
        flex-wrap: wrap;
        gap: 8px;
        padding: 10px;
    }

    .inventaire-item-name {
        flex: 1 1 100%;
        font-size: 14px;
    }

    .inventaire-qty-controls {
        flex: 1;
    }

    .inventaire-qty-controls .btn {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }

    .inventaire-qty {
        min-width: 50px;
        font-size: 13px;
    }

    .inventaire-item-actions {
        gap: 6px;
    }

    .inventaire-item-actions .btn {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }

    .inventaire-section-header {
        padding: 10px 0;
    }

    .inventaire-alerte-text {
        font-size: 11px;
        padding-left: 10px;
    }

    .card-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        width: 100%;
    }

    .card-actions .btn {
        flex: 1;
    }

    /* Pointage employes form */
    .form-group-btn-end {
        display: block;
    }

    .form-group-btn-end .btn {
        width: 100%;
    }
}

/* Production cuve sliders */
.cuve-slider-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 8px 0;
}

.cuve-slider {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: var(--border);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.cuve-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    border: 2px solid var(--primary-dark);
    transition: transform 0.15s ease;
}

.cuve-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

.cuve-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    border: 2px solid var(--primary-dark);
}

.cuve-litres-display {
    min-width: 52px;
    text-align: right;
    font-weight: 600;
    color: var(--primary);
    font-size: 14px;
}

/* Production cuve sliders */
.cuve-slider-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 8px 0;
}

.cuve-slider {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: var(--border);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.cuve-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    border: 2px solid var(--primary-dark);
    transition: transform 0.15s ease;
}

.cuve-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

.cuve-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    border: 2px solid var(--primary-dark);
}

.cuve-litres-display {
    min-width: 52px;
    text-align: right;
    font-weight: 600;
    color: var(--primary);
    font-size: 14px;
}
