
:root {
    --primary: #183D30;
    --primary-light: #285C47;
    --background: #F3F5F4;
    --white: #FFFFFF;
    --text: #17231D;
    --muted: #66736B;
    --border: #DCE3DE;
    --warning: #926000;
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont,
        "Segoe UI", Arial, sans-serif;
    background: var(--background);
    color: var(--text);
    line-height: 1.5;
}

header {
    background: var(--primary);
    color: var(--white);
    padding: 28px 20px;
    text-align: center;
}

header h1 {
    margin: 0;
    font-size: 30px;
    letter-spacing: 3px;
}

header p {
    margin: 5px 0 0;
    font-size: 14px;
    opacity: 0.85;
}

main {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px 16px;
    min-height: 70vh;
}

h2 {
    font-size: 24px;
    margin: 0 0 20px;
}

h3 {
    font-size: 20px;
    margin: 24px 0 12px;
}

#login-section {
    max-width: 420px;
    margin: 30px auto;
    padding: 28px;
    background: var(--white);
    border-radius: 16px;
    border: 1px solid var(--border);
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
}

label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
}

input {
    width: 100%;
    padding: 15px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 16px;
    background: var(--white);
    color: var(--text);
    margin-bottom: 16px;
}

input:focus {
    outline: 2px solid var(--primary-light);
    outline-offset: 2px;
}

button {
    border: 0;
    border-radius: 10px;
    padding: 14px 18px;
    min-height: 44px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    background: var(--primary);
    color: var(--white);
    touch-action: manipulation;
}

button:hover {
    background: var(--primary-light);
}

button:focus-visible {
    outline: 3px solid var(--primary-light);
    outline-offset: 3px;
}

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

#login-form button {
    width: 100%;
    margin-top: 6px;
}

#login-message {
    color: #B42318;
    font-size: 14px;
}

.user-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

#user-role {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary);
}

#logout-button {
    background: var(--white);
    color: var(--primary);
    border: 1px solid var(--border);
}

.scan-button {
    width: 100%;
    padding: 24px;
    font-size: 18px;
    border-radius: 14px;
}

.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.filters button {
    background: var(--white);
    color: var(--primary);
    border: 1px solid var(--border);
}

.filters button.active {
    background: var(--primary);
    color: var(--white);
}

#result-count {
    color: var(--muted);
    font-size: 14px;
}

#product-list {
    display: grid;
    grid-template-columns: repeat(
        auto-fill, minmax(150px, 1fr)
    );
    gap: 12px;
}

.product-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
}

.product-card img {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    background: #E8ECE9;
}

.product-info {
    padding: 12px;
    overflow-wrap: anywhere;
}

.product-code {
    display: inline-block;
    background: #E5EEE8;
    color: var(--primary);
    font-weight: 700;
    font-size: 12px;
    padding: 4px 9px;
    border-radius: 6px;
}

.product-name {
    font-size: 17px;
    font-weight: 700;
    margin: 8px 0 4px;
}

.product-color {
    color: var(--muted);
    font-size: 13px;
}

.product-status {
    color: var(--warning);
    font-size: 12px;
    margin-top: 8px;
}

.product-status.confirmed {
    color: #18743A;
}

.no-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    background: #E8ECE9;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    font-size: 13px;
    text-align: center;
    padding: 12px;
}

footer {
    padding: 24px 16px;
    text-align: center;
    font-size: 12px;
    color: var(--muted);
}

@media (min-width: 768px) {
    #product-list {
        grid-template-columns: repeat(
            auto-fill, minmax(210px, 1fr)
        );
        gap: 20px;
    }
}
