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

body {
    font-family: system-ui, -apple-system, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #734607 0%, #1c57a4 100%);
    min-height: 100vh;
    padding: 1rem;
}

header {
    text-align: center;
    color: white;
    margin-bottom: 2rem;
    padding: 2rem 1rem;
    background: rgba(255,255,255,0.1);
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
}

header h1 {
    font-size: clamp(1.75rem, 5vw, 2.5rem);
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

main {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    max-width: 900px;
    margin: 0 auto;
}

section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    padding: 1.75rem;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

section:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.15);
}

section h2 {
    font-size: 1.25rem;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.product-card {
    padding: 0.50rem 0;
    border-bottom: 1px solid #dcdfe4;
}

.product-card:last-child {
    border-bottom: none;
}

.product-card p {
    margin-bottom: 0.35rem;
}

.product-card h3 {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
}

.product-card label {
    font-weight: 500;
    margin-right: 0.5rem;
}

.product-card input {
    padding: 0.4rem 0.6rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.95rem;
    width: 80px;
}

.onDailyTarget {
    color: #1b8a3d;
    font-weight: 600;
}

.offDailyTarget {
    color: #c0392b;
    font-weight: 600;
}

button {
    border: 0;
    border-radius: 10px;
    padding: 0.55rem 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.04s ease, opacity 0.2s ease, background-color 0.2s ease;
}

button:active {
    transform: translateY(1px);
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

#barcode-form button[type="submit"] {
    background: #2563eb;
    color: #fff;
}

#barcode-form button[type="submit"]:hover:not(:disabled) {
    background: #1d4ed8;
}

.product-card button[type="button"] {
    background: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.product-card button[type="button"]:hover {
    background: #fecaca;
}

#barcode-input {
    padding: 0.4rem 0.6rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.95rem;
}

@media (min-width: 768px) {
    main {
        grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
        gap: 2rem;
    }
    
    #products {
        grid-column: 1 / -1;
    }
}