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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
    padding: 30px;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 20px;
}

h1 {
    color: #78350f;
    font-size: 28px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.beer-icon {
    font-size: 32px;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: #d97706;
    color: white;
}

.btn-primary:hover {
    background: #b45309;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(217, 119, 6, 0.3);
}

.btn-secondary {
    background: #f3f4f6;
    color: #374151;
}

.btn-secondary:hover {
    background: #e5e7eb;
}

.btn-export {
    background: #10b981;
    color: white;
}

.btn-export:hover {
    background: #059669;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-danger {
    background: #ef4444;
    color: white;
    padding: 8px 16px;
    font-size: 13px;
}

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

.btn-icon {
    padding: 10px;
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.icon-img {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.btn-edit {
    background: #3b82f6;
    color: white;
    padding: 8px 16px;
    font-size: 13px;
}

.btn-edit:hover {
    background: #2563eb;
}

.btn-archive {
    background: #6b7280;
    color: white;
    padding: 8px 16px;
    font-size: 13px;
}

.btn-archive:hover {
    background: #4b5563;
}

.filters {
    background: #fef3c7;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: center;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.filter-group label {
    font-size: 12px;
    font-weight: 600;
    color: #78350f;
    text-transform: uppercase;
}

.filter-group input {
    padding: 8px 12px;
    border: 2px solid #fbbf24;
    border-radius: 6px;
    font-size: 14px;
}

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.stat-card {
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    border-color: #fbbf24;
}

.stat-icon {
    font-size: 48px;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-radius: 16px;
    flex-shrink: 0;
}

.stat-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-value {
    font-size: 36px;
    font-weight: 800;
    color: #78350f;
    line-height: 1;
}

.stat-label {
    font-size: 14px;
    font-weight: 600;
    color: #92400e;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-details {
    margin-top: 8px;
    font-size: 13px;
    color: #6b7280;
}

.stat-detail-item {
    display: inline-block;
}

.stat-card-stock {
    position: relative;
    overflow: visible;
}

.btn-add-stock {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
    color: white;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(217, 119, 6, 0.3);
    transition: all 0.3s ease;
}

.btn-add-stock:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(217, 119, 6, 0.4);
}

.btn-add-stock:active {
    transform: scale(0.95);
}

.stat-card-alert {
    border-color: #ef4444 !important;
    background: #fef2f2;
}

.stat-card-alert .stat-value {
    color: #dc2626;
}

.stat-card-alert .stat-icon {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
}

.stat-card-ok {
    border-color: #10b981 !important;
}

.stat-card-ok .stat-icon {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
}

.table-wrapper {
    overflow-x: auto;
    margin-top: 20px;
}

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

thead {
    background: #78350f;
    color: white;
}

th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
}

th[onclick] {
    user-select: none;
    transition: background 0.2s;
}

th[onclick]:hover {
    background: #92400e;
}

.sort-arrow {
    font-size: 12px;
    margin-left: 5px;
    opacity: 0.3;
    transition: opacity 0.2s;
}

td {
    padding: 15px;
    border-bottom: 1px solid #f3f4f6;
}

tbody tr:hover {
    background: #fef3c7;
}

.badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    position: relative;
}

.badge-confirmee {
    background: #dbeafe;
    color: #1e40af;
}

.badge-recuperee {
    background: #fef3c7;
    color: #92400e;
}

.badge-retournee {
    background: #dcfce7;
    color: #166534;
}

.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    background: white;
    min-width: 180px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    z-index: 1000;
    margin-top: 5px;
    overflow: hidden;
}

.dropdown-content.show {
    display: block;
}

.dropdown-item {
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.2s;
    font-size: 14px;
}

.dropdown-item:hover {
    background: #f3f4f6;
}

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

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s;
}

.modal.show {
    display: flex;
}

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

.modal-content {
    background: white;
    border-radius: 16px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h2 {
    color: #78350f;
    font-size: 24px;
}

.close-btn {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #6b7280;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    color: #374151;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #374151;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #d97706;
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 30px;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6b7280;
}

.empty-state-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.empty-state h3 {
    font-size: 20px;
    margin-bottom: 10px;
    color: #374151;
}

.archived-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    background: #f3f4f6;
    border-radius: 8px;
    cursor: pointer;
    user-select: none;
}

.archived-toggle input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.comment-icon {
    font-size: 20px;
    cursor: help;
    position: relative;
    display: inline-block;
}

.comment-icon.has-comment {
    color: #3b82f6;
}

.comment-icon.no-comment {
    color: #ef4444;
}

.tooltip {
    visibility: hidden;
    background-color: #1f2937;
    color: white;
    text-align: left;
    border-radius: 8px;
    padding: 12px 16px;
    position: absolute;
    z-index: 1000;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    min-width: 200px;
    max-width: 300px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    font-size: 13px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-wrap: break-word;
    opacity: 0;
    transition: opacity 0.3s, visibility 0.3s;
}

.tooltip::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #1f2937 transparent transparent transparent;
}

.comment-icon:hover .tooltip {
    visibility: visible;
    opacity: 1;
}

/* Media Queries */
@media (max-width: 768px) {
    .container {
        padding: 20px;
    }

    h1 {
        font-size: 22px;
    }

    .filters {
        flex-direction: column;
        align-items: stretch;
    }

    .stats {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .stat-card {
        padding: 20px;
    }

    .btn-add-stock {
        width: 40px;
        height: 40px;
        font-size: 20px;
        top: 16px;
        right: 16px;
    }

    .stat-icon {
        font-size: 40px;
        width: 64px;
        height: 64px;
    }

    .stat-value {
        font-size: 28px;
    }

    .stat-label {
        font-size: 12px;
    }

    table {
        font-size: 12px;
    }

    th, td {
        padding: 10px 8px;
    }

    .actions {
        flex-direction: row;
        justify-content: center;
    }

    .btn {
        font-size: 12px;
        padding: 8px 12px;
    }

    .btn-icon {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }

    .icon-img {
        width: 18px;
        height: 18px;
    }

    .tooltip {
        min-width: 150px;
        max-width: 200px;
        font-size: 12px;
        padding: 8px 12px;
    }
}