.admin-page {
    background: #f4f5ef;
}

.admin-topbar {
    position: sticky;
    z-index: 20;
    top: 0;
    display: flex;
    width: 100%;
    max-width: 1304px;
    min-height: 78px;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 0 32px;
    margin: 0 auto;
    border-bottom: 1px solid rgba(224, 230, 220, .88);
    background: rgba(248, 249, 244, .9);
    backdrop-filter: blur(18px);
}

.admin-topbar-label {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin-left: auto;
    color: #7c897c;
    font-size: .64rem;
    font-weight: 700;
    letter-spacing: .15em;
}

.admin-topbar-label i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #9fbd67;
    box-shadow: 0 0 0 4px rgba(159, 189, 103, .15);
}

.admin-topbar-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: 16px;
}

.admin-topbar-actions .button {
    min-height: 41px;
    font-size: .78rem;
}

.admin-main {
    width: min(100% - 64px, 1240px);
    margin: 0 auto;
    padding: 62px 0 90px;
}

.admin-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 30px;
    margin-bottom: 39px;
    animation: rise-in .58s both var(--ease-out);
}

.admin-heading .eyebrow {
    margin-bottom: 12px;
}

.admin-heading h1 {
    margin: 0;
    font-size: clamp(3.3rem, 6.6vw, 6.2rem);
    font-weight: 600;
    letter-spacing: -.09em;
    line-height: .89;
}

.admin-heading h1 em {
    color: #7f9a52;
}

.admin-heading-note {
    display: flex;
    align-items: center;
    gap: 13px;
    margin-bottom: 4px;
    padding: 13px 17px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(255, 255, 251, .58);
}

.admin-avatar {
    display: grid;
    width: 39px;
    height: 39px;
    flex: 0 0 39px;
    place-items: center;
    border-radius: 50%;
    background: var(--lime);
    color: var(--ink);
    font-size: 1.1rem;
}

.admin-heading-note p {
    margin: 0;
    color: #89938a;
    font-size: .7rem;
    line-height: 1.55;
}

.admin-heading-note strong {
    color: #4e5b51;
    font-size: .75rem;
}

.inventory-workspace {
    display: grid;
    grid-template-columns: minmax(290px, .72fr) minmax(0, 1.55fr);
    align-items: start;
    gap: 23px;
}

.product-form-panel,
.inventory-panel {
    border: 1px solid rgba(224, 230, 220, .85);
    border-radius: 23px;
    background: rgba(255, 255, 251, .82);
    box-shadow: 0 14px 44px rgba(31, 47, 38, .055);
}

.product-form-panel {
    position: sticky;
    top: 102px;
    padding: 25px;
    animation: rise-in .62s .06s both var(--ease-out);
}

.panel-heading .eyebrow {
    margin-bottom: 12px;
}

.panel-heading h2 {
    margin: 0;
    font-size: 1.58rem;
    letter-spacing: -.06em;
}

.panel-heading > p:last-child {
    margin: 8px 0 22px;
    color: #89938a;
    font-size: .79rem;
    line-height: 1.55;
}

.product-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.product-form .form-field {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.product-form label {
    color: #536158;
    font-size: .72rem;
    font-weight: 700;
}

.product-form label span {
    color: #9ba49b;
    font-weight: 500;
}

.product-form input,
.product-form select {
    width: 100%;
    min-height: 45px;
    padding: 0 12px;
    border: 1px solid #e0e5dc;
    border-radius: 11px;
    appearance: none;
    background-color: #fbfcf8;
    color: var(--ink);
    font-size: .79rem;
    transition: border-color .2s ease, background .2s ease, box-shadow .2s ease;
}

.product-form select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='m2 4 4 4 4-4' stroke='%23758078' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-position: right 13px center;
    background-repeat: no-repeat;
}

.product-form input::placeholder {
    color: #a3aca3;
}

.product-form input:focus,
.product-form select:focus {
    border-color: #a7bc89;
    outline: 0;
    background-color: #fff;
    box-shadow: 0 0 0 3px rgba(181, 215, 129, .17);
}

.admin-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 11px;
}

.product-form-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 3px;
}

.product-form-actions .button {
    min-height: 47px;
    font-size: .81rem;
}

.product-form-actions #save-product {
    justify-content: space-between;
    padding-right: 17px;
    padding-left: 17px;
}

.product-form-actions #save-product span {
    display: grid;
    width: 25px;
    height: 25px;
    place-items: center;
    border-radius: 50%;
    background: var(--lime);
    color: var(--ink);
    font-size: 1.1rem;
}

.admin-form-message {
    margin: 0;
    padding: 10px 12px;
    border-radius: 10px;
    background: #fff3eb;
    color: #9d5940;
    font-size: .74rem;
    line-height: 1.5;
}

.admin-form-message.is-success {
    background: #f2f8e7;
    color: #5d7838;
}

.form-footnote {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-top: 20px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
    color: #9aa39b;
    font-size: .64rem;
}

.form-footnote span {
    color: #95ad64;
}

.inventory-panel {
    min-height: 514px;
    padding: 25px;
    animation: rise-in .62s .14s both var(--ease-out);
}

.inventory-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 20px;
}

.inventory-heading .eyebrow {
    margin-bottom: 8px;
}

.inventory-heading h2 {
    display: flex;
    align-items: center;
    gap: 11px;
    margin: 0;
    font-size: 1.35rem;
    letter-spacing: -.055em;
}

.inventory-heading h2 span {
    display: grid;
    min-width: 25px;
    height: 25px;
    place-items: center;
    padding: 0 6px;
    border-radius: 99px;
    background: #edf3e2;
    color: #627b3d;
    font-size: .68rem;
    letter-spacing: 0;
}

.clear-inventory {
    padding: 7px 0;
    border: 0;
    background: transparent;
    color: #9a8073;
    cursor: pointer;
    font-size: .7rem;
    font-weight: 600;
    text-decoration: underline;
    text-decoration-color: transparent;
    text-underline-offset: 3px;
    transition: color .2s ease, text-decoration-color .2s ease;
}

.clear-inventory:hover:not(:disabled) {
    color: #b56045;
    text-decoration-color: currentColor;
}

.clear-inventory:disabled {
    color: #aab1a9;
    cursor: not-allowed;
}

.inventory-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.inventory-card {
    position: relative;
    display: grid;
    min-width: 0;
    grid-template-columns: 82px minmax(0, 1fr);
    gap: 13px;
    padding: 11px;
    border: 1px solid #e8ece5;
    border-radius: 16px;
    background: #fff;
    animation: rise-in .42s both var(--ease-out);
    transition: transform .23s var(--ease-out), box-shadow .23s ease, border-color .23s ease;
}

.inventory-card:hover {
    border-color: #d8e1d1;
    box-shadow: 0 12px 26px rgba(31, 47, 38, .075);
    transform: translateY(-2px);
}

.inventory-card-image {
    width: 82px;
    height: 94px;
    grid-row: 1 / span 2;
    border-radius: 11px;
    background: #e7eadf;
    object-fit: cover;
}

.inventory-card-content {
    min-width: 0;
}

.inventory-card-category {
    margin: 1px 0 5px;
    color: #8a958b;
    font-size: .57rem;
    font-weight: 700;
    letter-spacing: .11em;
    text-transform: uppercase;
}

.inventory-card-name {
    overflow: hidden;
    margin: 0;
    color: var(--ink);
    font-size: .82rem;
    font-weight: 700;
    letter-spacing: -.03em;
    line-height: 1.3;
    text-overflow: ellipsis;
}

.inventory-card-price {
    margin: 5px 0 0;
    color: #5c6c60;
    font-size: .74rem;
    font-weight: 700;
}

.inventory-card-stock {
    display: flex;
    align-items: center;
    gap: 5px;
    margin: 6px 0 0;
    color: #879287;
    font-size: .63rem;
}

.inventory-card-stock::before {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #9dbb6b;
    content: '';
}

.inventory-card-stock.is-low {
    color: #b37454;
}

.inventory-card-stock.is-low::before {
    background: #d88763;
}

.inventory-card-actions {
    display: flex;
    grid-column: 2;
    gap: 14px;
    align-self: end;
}

.inventory-card-actions button {
    padding: 0;
    border: 0;
    background: transparent;
    color: #718071;
    cursor: pointer;
    font-size: .65rem;
    font-weight: 700;
    text-decoration: underline;
    text-decoration-color: transparent;
    text-underline-offset: 3px;
    transition: color .2s ease, text-decoration-color .2s ease;
}

.inventory-card-actions button:hover {
    color: #5f7d38;
    text-decoration-color: currentColor;
}

.inventory-card-actions button[data-action="delete"]:hover {
    color: #ba624a;
}

.inventory-empty {
    display: flex;
    min-height: 330px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 25px;
    border: 1px dashed #d2dbce;
    border-radius: 16px;
    text-align: center;
}

.inventory-empty > span {
    display: grid;
    width: 46px;
    height: 46px;
    place-items: center;
    margin-bottom: 10px;
    border-radius: 50%;
    background: var(--lime);
    color: var(--ink);
    font-size: 1.2rem;
}

.inventory-empty h3 {
    margin: 4px 0;
    font-size: 1.1rem;
    letter-spacing: -.04em;
}

.inventory-empty p {
    margin: 5px 0 0;
    color: #89938a;
    font-size: .76rem;
}

@media (max-width: 1050px) {
    .inventory-workspace {
        grid-template-columns: minmax(275px, .8fr) minmax(0, 1.25fr);
    }

    .inventory-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .admin-topbar {
        min-height: 69px;
        padding: 0 19px;
        gap: 12px;
    }

    .admin-topbar-label {
        display: none;
    }

    .admin-topbar-actions {
        margin-left: auto;
    }

    .admin-topbar-actions .button {
        min-height: 39px;
        padding: 0 10px;
        font-size: .7rem;
    }

    .admin-main {
        width: min(100% - 38px, 1240px);
        padding: 47px 0 65px;
    }

    .admin-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 24px;
        margin-bottom: 27px;
    }

    .admin-heading h1 {
        font-size: clamp(3.5rem, 13vw, 5.4rem);
    }

    .inventory-workspace {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .product-form-panel {
        position: static;
    }

    .inventory-panel {
        min-height: 0;
    }

    .inventory-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 510px) {
    .product-form-panel,
    .inventory-panel {
        padding: 19px;
        border-radius: 19px;
    }

    .inventory-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .inventory-grid {
        grid-template-columns: 1fr;
    }
}
