﻿/* =========================================================
   Grocery Catalog — Glass UI
   ========================================================= */

:root {
    color-scheme: light;
    --ink: #17251f;
    --muted: #68776f;
    --green: #087653;
    --green-dark: #075b40;
    --green-soft: #e8f5ee;
    --line: rgba(255, 255, 255, .78);
    --glass: rgba(255, 255, 255, .68);
    --glass-strong: rgba(255, 255, 255, .82);
    --shadow: 0 18px 55px rgba(24, 55, 42, .09);
    --radius: 22px;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--ink);
    font: 15px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: radial-gradient(ellipse at 8% 0%, rgba(255,255,255,.98) 0, transparent 34rem), radial-gradient(ellipse at 95% 8%, rgba(169, 230, 202, .48) 0, transparent 31rem), radial-gradient(ellipse at 50% 100%, rgba(222, 237, 255, .7) 0, transparent 35rem), linear-gradient(135deg, #f4f8f5 0%, #edf4f0 48%, #f5f7fb 100%);
    background-attachment: fixed;
}

    body::before {
        position: fixed;
        z-index: -1;
        inset: 0;
        content: "";
        pointer-events: none;
        opacity: .22;
        background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.12'/%3E%3C/svg%3E");
    }

a {
    color: var(--green);
    text-decoration: none;
}

    a:hover {
        color: var(--green-dark);
    }

button,
input,
select {
    font: inherit;
}

button,
.button {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 17px;
    border: 1px solid rgba(7, 91, 64, .12);
    border-radius: 13px;
    color: #fff;
    background: linear-gradient(135deg, #0b8b60, #076346);
    box-shadow: 0 8px 20px rgba(7, 99, 70, .18), inset 0 1px 0 rgba(255,255,255,.2);
    font-weight: 650;
    cursor: pointer;
    transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}

    button:hover,
    .button:hover {
        color: #fff;
        filter: brightness(1.05);
        transform: translateY(-1px);
        box-shadow: 0 12px 25px rgba(7, 99, 70, .22);
    }

    button:active {
        transform: translateY(0);
    }

    button:focus-visible,
    a:focus-visible,
    input:focus-visible,
    select:focus-visible,
    summary:focus-visible {
        outline: 3px solid rgba(16, 157, 111, .25);
        outline-offset: 2px;
    }

main {
    width: min(1440px, 100%);
    margin: 0 auto;
    padding: 34px clamp(16px, 3vw, 38px) 64px;
}

.page-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin: 8px 0 24px;
}

.eyebrow {
    margin: 0 0 7px;
    color: var(--green);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .16em;
    text-transform: uppercase;
}

h1 {
    margin: 0;
    color: #14251d;
    font-size: clamp(30px, 4vw, 42px);
    font-weight: 780;
    letter-spacing: -.045em;
    line-height: 1.08;
}

h2, h3 {
    color: #183328;
    letter-spacing: -.025em;
}

.sub {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 14px;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 13px;
    font-size: 16px;
    font-weight: 750;
}

    .section-title .step {
        display: inline-grid;
        width: 28px;
        height: 28px;
        place-items: center;
        border-radius: 9px;
        color: var(--green-dark);
        background: #e2f4e9;
        font-size: 12px;
    }

.bar,
.row,
.glass-panel,
table {
    border: 1px solid var(--line);
    background: var(--glass);
    box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.72);
    backdrop-filter: blur(22px) saturate(145%);
    -webkit-backdrop-filter: blur(22px) saturate(145%);
}

.bar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 14px;
    padding: 19px;
    margin: 0 0 18px;
    border-radius: var(--radius);
}

    .bar > div {
        min-width: 150px;
        flex: 1 1 150px;
    }

    .bar button {
        flex: 0 0 auto;
    }

label {
    display: block;
    margin: 0 0 6px;
    color: #586a60;
    font-size: 11px;
    font-weight: 750;
    letter-spacing: .055em;
    text-transform: uppercase;
}

input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"],
select {
    width: 100%;
    min-width: 0;
    height: 43px;
    padding: 0 12px;
    border: 1px solid rgba(110, 143, 124, .23);
    border-radius: 12px;
    outline: none;
    color: #20362b;
    background: rgba(255,255,255,.78);
    box-shadow: inset 0 1px 2px rgba(28, 65, 46, .035);
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

input::placeholder {
    color: #9aa79f;
}

input[type="text"]:focus,
input[type="number"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
select:focus {
    border-color: rgba(8, 137, 94, .55);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(8, 137, 94, .09);
}

input[type="file"] {
    max-width: 100%;
    color: var(--muted);
    font: inherit;
}

.note,
.err {
    padding: 12px 15px;
    margin: 0 0 16px;
    border-radius: 13px;
    font-weight: 600;
}

.note {
    border: 1px solid rgba(20, 142, 93, .16);
    color: #08734d;
    background: rgba(226, 247, 235, .82);
}

.err {
    border: 1px solid rgba(190, 66, 56, .18);
    color: #a33b32;
    background: rgba(255, 237, 234, .88);
}

.catalog-list {
    display: grid;
    gap: 13px;
    margin-top: 18px;
}

.card {
    min-width: 0;
    padding: 18px;
    margin: 0;
    border-radius: 20px;
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}

    .card:hover {
        transform: translateY(-2px);
        background: rgba(255,255,255,.78);
        box-shadow: 0 22px 58px rgba(24,55,42,.12), inset 0 1px 0 rgba(255,255,255,.8);
    }

    .card form {
        display: grid;
        grid-template-columns: 82px minmax(180px, 1.5fr) minmax(145px, .8fr) minmax(145px, .8fr) auto;
        align-items: center;
        gap: 14px;
    }

.photo {
    display: block;
    width: 82px;
    height: 82px;
    object-fit: contain;
    padding: 6px;
    border: 1px solid rgba(110,143,124,.13);
    border-radius: 16px;
    background: rgba(255,255,255,.82);
}

.name {
    color: #1c3328;
    font-size: 15px;
    font-weight: 780;
    line-height: 1.35;
}

.product-meta {
    margin-top: 5px;
    color: #78877e;
    font-size: 12px;
}

.path,
.now {
    overflow-wrap: anywhere;
    margin-top: 7px;
    font-size: 11px;
    line-height: 1.45;
}

.path {
    color: #718078;
}

.now {
    color: #a4473e;
}

.card .row-category,
.card .row-subcategory {
    min-width: 0;
}

.card-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

    .card-actions button {
        min-height: 39px;
        padding: 0 14px;
        white-space: nowrap;
    }

.editbox {
    grid-column: 2 / -1;
    min-width: 0;
    padding-top: 4px;
}

    .editbox summary {
        display: inline-flex;
        min-height: 36px;
        align-items: center;
        padding: 0 13px;
        border: 1px solid rgba(8, 137, 94, .15);
        border-radius: 11px;
        color: var(--green-dark);
        background: rgba(226, 245, 234, .9);
        font-size: 13px;
        font-weight: 700;
        cursor: pointer;
        list-style: none;
    }

        .editbox summary::-webkit-details-marker {
            display: none;
        }

        .editbox summary::after {
            content: "+";
            margin-left: 9px;
            font-size: 17px;
            line-height: 1;
        }

    .editbox[open] summary::after {
        content: "−";
    }

.item-fields {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px;
    padding: 14px;
    margin-top: 10px;
    border: 1px solid rgba(120, 157, 135, .16);
    border-radius: 15px;
    background: rgba(245, 251, 247, .8);
}

    .item-fields > div {
        min-width: 130px;
        flex: 1 1 130px;
    }

    .item-fields button {
        min-height: 43px;
    }

.empty-state {
    padding: 36px 20px;
    border: 1px dashed rgba(88, 130, 105, .28);
    border-radius: 20px;
    color: var(--muted);
    background: rgba(255,255,255,.42);
    text-align: center;
}

    .empty-state strong {
        display: block;
        margin-bottom: 5px;
        color: #294536;
        font-size: 16px;
    }

nav {
    position: sticky;
    z-index: 20;
    top: 12px;
    display: flex;
    width: min(1440px, calc(100% - 32px));
    min-height: 66px;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    margin: 12px auto 0;
    border: 1px solid rgba(255,255,255,.84);
    border-radius: 19px;
    background: rgba(255,255,255,.72);
    box-shadow: 0 12px 38px rgba(24,55,42,.09), inset 0 1px 0 rgba(255,255,255,.9);
    backdrop-filter: blur(24px) saturate(150%);
    -webkit-backdrop-filter: blur(24px) saturate(150%);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 16px 0 7px;
    color: #17372a;
    font-size: 16px;
    font-weight: 850;
    letter-spacing: -.03em;
    white-space: nowrap;
}

.brand-mark {
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    border-radius: 12px;
    color: #fff;
    background: linear-gradient(145deg, #19a875, #075b40);
    box-shadow: 0 6px 14px rgba(7,99,70,.2);
    font-size: 17px;
}

nav a:not(.nav-brand) {
    display: inline-flex;
    min-height: 40px;
    align-items: center;
    padding: 0 13px;
    border-radius: 11px;
    color: #52685c;
    font-size: 13px;
    font-weight: 700;
    transition: color .18s ease, background .18s ease;
}

    nav a:not(.nav-brand):hover,
    nav a.active {
        color: var(--green-dark);
        background: rgba(222, 244, 231, .9);
    }

nav form {
    margin-left: auto;
}

    nav form button {
        min-height: 39px;
        border-radius: 11px;
        font-size: 13px;
    }

table {
    width: 100%;
    border-spacing: 0;
    border-collapse: separate;
    overflow: hidden;
    border-radius: 18px;
}

th,
td {
    padding: 12px 14px;
    border-bottom: 1px solid rgba(113, 143, 124, .13);
    text-align: left;
    vertical-align: top;
    font-size: 13px;
}

th {
    color: #52675b;
    background: rgba(239, 248, 242, .78);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
}

tr:last-child td {
    border-bottom: 0;
}

tr.unsure {
    background: rgba(255, 246, 226, .72);
}

tr.decided .state {
    color: var(--green);
}

.state,
.hint {
    margin-top: 4px;
    font-size: 12px;
}

.hint {
    color: #a4473e;
}

.counts {
    align-items: center;
}

    .counts .plain {
        border: 1px solid rgba(110,143,124,.2);
        color: #294536;
        background: rgba(255,255,255,.78);
        box-shadow: none;
    }

.checkline {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 0;
    color: #34483d;
    font-size: 14px;
    text-transform: none;
    letter-spacing: 0;
}

    .checkline input {
        width: 18px;
        height: 18px;
        accent-color: var(--green);
    }

.details {
    width: 100%;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px;
}

    .actions > div {
        min-width: 180px;
    }

.login-screen {
    display: flex;
    width: 100%;
    min-height: 100vh;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.glass-card {
    width: min(100%, 440px);
    padding: 38px;
    border: 1px solid rgba(255,255,255,.9);
    border-radius: 28px;
    background: rgba(255,255,255,.7);
    box-shadow: 0 28px 80px rgba(31,83,57,.14), inset 0 1px 0 rgba(255,255,255,.9);
    backdrop-filter: blur(26px) saturate(150%);
    -webkit-backdrop-filter: blur(26px) saturate(150%);
}

    .glass-card .eyebrow {
        margin: 0 0 9px;
        color: var(--green);
        font-size: 11px;
        font-weight: 800;
        letter-spacing: .16em;
        text-transform: uppercase;
    }

    .glass-card h1 {
        font-size: 38px;
    }

.login-form {
    display: flex;
    flex-direction: column;
    gap: 13px;
    margin-top: 25px;
}

    .login-form input[type="text"],
    .login-form input[type="password"] {
        height: 49px;
        border-radius: 14px;
    }

    .login-form button {
        width: 100%;
        min-height: 49px;
        margin-top: 5px;
        border-radius: 14px;
    }

@media (max-width: 1050px) {
    .card form {
        grid-template-columns: 76px minmax(160px, 1fr) minmax(140px, .8fr) minmax(140px, .8fr);
    }

    .card-actions {
        grid-column: 2 / -1;
        justify-content: flex-start;
    }

    .editbox {
        grid-column: 2 / -1;
    }
}

@media (max-width: 720px) {
    nav {
        position: static;
        width: calc(100% - 20px);
        flex-wrap: wrap;
        gap: 4px;
        padding: 10px;
        margin-top: 10px;
    }

    .nav-brand {
        width: 100%;
        padding: 2px 6px 8px;
    }

    nav a:not(.nav-brand) {
        flex: 1 1 auto;
        justify-content: center;
        padding: 0 9px;
        font-size: 12px;
    }

    nav form {
        margin-left: auto;
    }

        nav form button {
            min-height: 36px;
        }

    main {
        padding: 25px 13px 44px;
    }

    .page-heading {
        display: block;
        margin-bottom: 19px;
    }

    .bar {
        gap: 11px;
        padding: 14px;
        border-radius: 18px;
    }

        .bar > div {
            min-width: calc(50% - 6px);
            flex: 1 1 calc(50% - 6px);
        }

        .bar button {
            flex: 1 1 auto;
        }

    .card {
        padding: 13px;
    }

        .card form {
            grid-template-columns: 66px minmax(0, 1fr);
            gap: 11px;
        }

    .photo {
        width: 66px;
        height: 66px;
    }

    .card form > div:nth-of-type(2),
    .card form > div:nth-of-type(3),
    .card-actions,
    .editbox {
        grid-column: 1 / -1;
    }

    .card-actions {
        justify-content: stretch;
    }

        .card-actions button {
            flex: 1;
        }

    .item-fields {
        padding: 11px;
    }

        .item-fields > div {
            min-width: calc(50% - 6px);
            flex: 1 1 calc(50% - 6px);
        }

    .glass-card {
        padding: 29px 23px;
    }
}

@media (max-width: 420px) {
    .bar > div,
    .item-fields > div {
        min-width: 100%;
        flex-basis: 100%;
    }

    .glass-card h1 {
        font-size: 33px;
    }
}

@supports not (backdrop-filter: blur(1px)) {
    .bar,
    .row,
    .glass-panel,
    nav,
    table,
    .glass-card {
        background: rgba(255,255,255,.94);
    }
}
