.stock-management-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.stock-header {
    text-align: center;
    margin-bottom: 30px;
}

.stock-header h1 {
    color: #2c3e50;
    margin-bottom: 10px;
}

.stock-subtitle {
    color: #7f8c8d;
    font-size: 1.1em;
}

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 15px;
}

.stat-card.warning { border-left: 4px solid #f39c12; }
.stat-card.danger { border-left: 4px solid #e74c3c; }
.stat-card.success { border-left: 4px solid #27ae60; }

.stat-icon {
    font-size: 2em;
}

.stat-content h3 {
    margin: 0;
    font-size: 1.8em;
    color: #2c3e50;
}

.stat-content p {
    margin: 5px 0 0 0;
    color: #7f8c8d;
}

.quick-actions {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.action-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-primary { background: #3498db; color: white; }
.btn-secondary { background: #95a5a6; color: white; }
.btn-info { background: #17a2b8; color: white; }
.btn-success { background: #28a745; color: white; }
.btn-danger { background: #dc3545; color: white; }

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.products-section {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.table-controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.table-controls input,
.table-controls select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.table-container {
    overflow-x: auto;
}

.stock-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.stock-table th,
.stock-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.stock-table th {
    background: #f8f9fa;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
}

.stock-table th:hover {
    background: #e9ecef;
}

.status-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8em;
    font-weight: 500;
}

.status-good { background: #d4edda; color: #155724; }
.status-low { background: #fff3cd; color: #856404; }
.status-out { background: #f8d7da; color: #721c24; }

.actions {
    display: flex;
    gap: 5px;
}

.btn-small {
    padding: 5px 8px;
    border: none;
    background: #f8f9fa;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.9em;
}

.btn-small:hover {
    background: #e9ecef;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 20px;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    position: relative;
}

.close {
    position: absolute;
    right: 15px;
    top: 15px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #aaa;
}

.close:hover {
    color: #000;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

.low-stock-alerts {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border-left: 4px solid #f39c12;
}

.alert-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.low-stock-alerts .alert-category {
    margin-bottom: 1em;
}
.low-stock-alerts .category-toggle {
    width: 100%;
    text-align: left;
    font-weight: bold;
    margin-bottom: 0.2em;
    cursor: pointer;
}
.low-stock-alerts .alert-list {
    padding-left: 1em;
    border-left: 2px solid #ffc107;
    margin-bottom: 0.5em;
}

.inventory-category {
    margin-bottom: 1em;
}
.inventory-category .category-toggle {
    width: 100%;
    text-align: left;
    font-weight: bold;
    margin-bottom: 0.2em;
    cursor: pointer;
}
.inventory-category .category-table-container {
    padding-left: 1em;
    border-left: 2px solid #3498db;
    margin-bottom: 0.5em;
}

.alert-item {
    background: #fff3cd;
    padding: 15px;
    border-radius: 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.product-name {
    font-weight: 600;
    color: #856404;
}

.stock-level {
    color: #856404;
}

.reorder-point {
    color: #6c757d;
    font-size: 0.9em;
}

@media (max-width: 768px) {
    .dashboard-stats {
        grid-template-columns: 1fr;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .section-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .table-controls {
        justify-content: stretch;
    }
    
    .table-controls input,
    .table-controls select {
        flex: 1;
    }
}