* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
}

body {
    background: linear-gradient(145deg, #e0eafc 0%, #cfdef3 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

header {
    text-align: center;
    margin-bottom: 30px;
}

h1 {
    font-size: 2.5rem;
    color: #1e2f4e;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.05);
}

.subtitle {
    color: #2c3e66;
    font-style: italic;
    font-weight: 500;
}

.card {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(2px);
    border-radius: 32px;
    box-shadow: 0 20px 35px -12px rgba(0,0,0,0.15);
    padding: 24px 28px;
    margin-bottom: 30px;
    transition: all 0.2s ease;
    border: 1px solid rgba(255,255,255,0.6);
}

.card h2 {
    font-size: 1.6rem;
    margin-bottom: 20px;
    color: #1e2f4e;
    border-left: 6px solid #4c9aff;
    padding-left: 16px;
}

.form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    flex: 1;
    min-width: 140px;
}

label {
    display: block;
    font-weight: 600;
    color: #1a2c44;
    margin-bottom: 6px;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

input, select {
    width: 100%;
    padding: 10px 14px;
    font-size: 1rem;
    border: 1px solid #cbd5e1;
    border-radius: 20px;
    background: white;
    transition: 0.2s;
}

input:focus, select:focus {
    outline: none;
    border-color: #4c9aff;
    box-shadow: 0 0 0 3px rgba(76,154,255,0.2);
}

.quantity-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

.quantity-group input {
    flex: 1;
}

.quantity-group select {
    width: auto;
    min-width: 70px;
}

.btn {
    border: none;
    padding: 12px 24px;
    border-radius: 40px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.1s, background 0.2s;
}

.btn-primary {
    background: #2c6e9e;
    color: white;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.btn-primary:hover {
    background: #1f547c;
    transform: scale(1.01);
}

.btn-danger {
    background: #e0675a;
    color: white;
    padding: 6px 14px;
    font-size: 0.8rem;
}

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

.btn-small {
    padding: 6px 14px;
    font-size: 0.75rem;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
    margin-top: 20px;
}

.product-card {
    background: #fefefe;
    border-radius: 28px;
    padding: 16px 20px;
    box-shadow: 0 5px 12px rgba(0,0,0,0.05);
    border: 1px solid #eef2f8;
    transition: all 0.2s;
    position: relative;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 15px 25px -12px rgba(0,0,0,0.15);
}

.product-name {
    font-size: 1.4rem;
    font-weight: 700;
    color: #1e2f4e;
    margin-bottom: 8px;
    word-break: break-word;
    padding-right: 60px;
}

.product-quantity {
    background: #e9f0f9;
    display: inline-block;
    padding: 4px 12px;
    border-radius: 30px;
    font-weight: 500;
    font-size: 0.9rem;
    margin: 8px 0;
}

.product-expiry {
    font-size: 0.85rem;
    color: #5b6e8c;
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.expiry-warning {
    color: #d9534f;
    font-weight: bold;
}

.nutrition {
    margin-top: 12px;
    font-size: 0.75rem;
    background: #f4f9ff;
    padding: 8px 12px;
    border-radius: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: space-between;
}

.nutrition span {
    font-weight: 600;
    color: #2c3e50;
}

.delete-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(224,103,90,0.1);
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: #e0675a;
    padding: 6px 10px;
    border-radius: 30px;
    transition: 0.2s;
}

.delete-btn:hover {
    background: #e0675a;
    color: white;
}

.loading, .empty-message {
    text-align: center;
    padding: 40px;
    font-size: 1.1rem;
    color: #4a627a;
}

@media (max-width: 700px) {
    .container {
        padding: 0;
    }
    .card {
        padding: 16px;
    }
    .products-grid {
        grid-template-columns: 1fr;
    }
}