:root {
    --primary: #667eea;
    --secondary: #764ba2;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #06b6d4;
    --light: #f3f4f6;
    --dark: #1f2937;
}

body {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    min-height: 100vh;
    font-family: 'Inter', sans-serif;
}

.inventaire-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.inventaire-header {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 25px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.37);
    color: white;
}

.inventaire-header h1 {
    margin: 0 0 15px 0;
    font-size: 28px;
    font-weight: 700;
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.kpi-card {
    background: rgba(255, 255, 255, 0.15);
    padding: 15px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    text-align: center;
}

.kpi-card h3 {
    margin: 0 0 8px 0;
    font-size: 12px;
    font-weight: 600;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.kpi-card .value {
    font-size: 28px;
    font-weight: 700;
}

.nav-tabs {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.2);
    overflow: hidden;
    margin-bottom: 25px;
}

.nav-tabs .nav-link {
    color: rgba(255, 255, 255, 0.8);
    border: none;
    padding: 12px 20px;
    font-weight: 500;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
}

.nav-tabs .nav-link:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

.nav-tabs .nav-link.active {
    color: white;
    background: rgba(255, 255, 255, 0.2);
    border-bottom-color: var(--success);
}

.filters-section {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.filters-section .form-control,
.filters-section .form-select {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 14px;
}

.filters-section .form-control::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.filters-section .form-control:focus,
.filters-section .form-select:focus {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    color: white;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

.filters-section .form-select option {
    background: #2d3748;
    color: white;
    padding: 8px 12px;
}

.filters-section .form-select option:hover {
    background: #4a5568;
}

.filters-section .form-select option:checked {
    background: #667eea;
    color: white;
}

.table-container {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    overflow: hidden;
}

.table {
    color: white;
    margin: 0;
}

.table thead {
    background: rgba(255, 255, 255, 0.15);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.table th {
    padding: 15px;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.9;
}

.table td {
    padding: 12px 15px;
    border-color: rgba(255, 255, 255, 0.1);
    vertical-align: middle;
}

.table tbody tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.table tbody tr:hover {
    background: rgba(255, 255, 255, 0.1);
}

.badge-stock {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
}

.badge-ok {
    background: var(--success);
    color: white;
}

.badge-faible {
    background: var(--warning);
    color: white;
}

.badge-rupture {
    background: var(--danger);
    color: white;
}

.btn-action {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.btn-add {
    background: var(--success);
    color: white;
}

.btn-add:hover {
    background: #059669;
    transform: scale(1.05);
}

.btn-remove {
    background: var(--danger);
    color: white;
}

.btn-remove:hover {
    background: #dc2626;
    transform: scale(1.05);
}

.btn-edit {
    background: var(--info);
    color: white;
}

.btn-edit:hover {
    background: #0891b2;
}

.btn-delete {
    background: #6b7280;
    color: white;
}

.btn-delete:hover {
    background: #4b5563;
}

.modal-content {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(240, 249, 255, 0.95) 100%);
    border: none;
    border-radius: 15px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
}

.modal-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    border: none;
    border-radius: 15px 15px 0 0;
}

.modal-header .btn-close {
    filter: brightness(0) invert(1);
}

.form-section {
    margin-bottom: 20px;
}

.form-section-title {
    background: rgba(102, 126, 234, 0.1);
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 12px;
    font-weight: 600;
    color: var(--primary);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.scanner-container {
    max-width: 600px;
    margin: 40px auto;
}

.scanner-input {
    width: 100%;
    padding: 15px;
    font-size: 18px;
    border-radius: 10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.1);
    color: white;
    text-align: center;
    font-weight: 500;
}

.scanner-input:focus {
    outline: none;
    border-color: var(--success);
    background: rgba(255, 255, 255, 0.15);
}

.scanner-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.product-display {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 25px;
    margin-top: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
}

.product-display .label {
    font-size: 12px;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 10px;
    display: block;
}

.product-display .value {
    font-size: 16px;
    font-weight: 600;
    margin-top: 5px;
}

.quantity-control {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    align-items: center;
    justify-content: center;
}

.qty-btn {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    border: none;
    font-size: 24px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
}

.qty-add {
    background: var(--success);
    color: white;
}

.qty-add:hover {
    background: #059669;
    transform: scale(1.1);
}

.qty-remove {
    background: var(--danger);
    color: white;
}

.qty-remove:hover {
    background: #dc2626;
    transform: scale(1.1);
}

.qty-display {
    background: rgba(255, 255, 255, 0.2);
    padding: 10px 20px;
    border-radius: 8px;
    min-width: 100px;
    text-align: center;
    font-weight: 600;
}

.history-section {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 20px;
    margin-top: 30px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
}

.history-section h3 {
    margin: 0 0 15px 0;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    opacity: 0.9;
}

.history-item {
    background: rgba(255, 255, 255, 0.1);
    padding: 10px 12px;
    border-radius: 6px;
    margin-bottom: 8px;
    font-size: 13px;
}

.history-item .code {
    font-weight: 600;
    color: var(--success);
}

.view-toggle {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.view-toggle button {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 8px 15px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.view-toggle button.active {
    background: var(--success);
    border-color: var(--success);
}

.view-toggle button:hover {
    background: rgba(255, 255, 255, 0.2);
}

.grid-view {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.grid-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    transition: all 0.3s ease;
}

.grid-card:hover {
    transform: translateY(-5px);
    border-color: rgba(255, 255, 255, 0.3);
}

.grid-card h4 {
    margin: 0 0 10px 0;
    font-size: 14px;
    font-weight: 700;
}

.grid-card .detail {
    font-size: 13px;
    opacity: 0.8;
    margin: 5px 0;
}

.grid-card .actions {
    display: flex;
    gap: 8px;
    margin-top: 15px;
    justify-content: space-between;
}

.alert-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 10px;
    padding: 15px 20px;
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    min-width: 300px;
    animation: slideIn 0.3s ease;
    z-index: 9999;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.alert-notification.success {
    border-left: 4px solid var(--success);
}

.alert-notification.error {
    border-left: 4px solid var(--danger);
}

.alert-notification.warning {
    border-left: 4px solid var(--warning);
}

@media (max-width: 768px) {
    .inventaire-header {
        padding: 15px;
    }

    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .grid-view {
        grid-template-columns: 1fr;
    }

    .table {
        font-size: 12px;
    }

    .table th, .table td {
        padding: 8px;
    }

    .filters-section {
        padding: 12px;
    }

    .scanner-container {
        margin: 20px auto;
    }
}
