.shop-admin-header,
.shop-admin-actions,
.shop-selected-item,
.shop-audit-heading {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.shop-admin-header {
    justify-content: space-between;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.shop-admin-header h2,
.shop-audit-heading h3 {
    margin: 0;
}

.shop-revision {
    display: inline-flex;
    align-items: center;
    min-height: 2rem;
    padding: 0.25rem 0.7rem;
    border: 1px solid #d4a57a;
    border-radius: 999px;
    background: #fffaf5;
    color: #6b3410;
    font-size: 0.85rem;
    font-weight: 700;
}

.shop-admin-panel {
    margin-bottom: 1.5rem;
    padding: 1.25rem;
    border: 2px solid #e8c4a8;
    border-radius: 10px;
    background: linear-gradient(180deg, #fffaf5 0%, #ffe8d1 100%);
}

.shop-admin-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(120px, 1fr));
    gap: 1rem;
}

.shop-field {
    min-width: 0;
}

.shop-field-wide {
    grid-column: span 2;
}

.shop-field label {
    display: block;
    margin-bottom: 0.4rem;
    color: #6b3410;
    font-weight: 700;
}

.shop-field input,
.shop-field select {
    box-sizing: border-box;
    width: 100%;
    min-height: 2.7rem;
    padding: 0.6rem 0.7rem;
    border: 2px solid #d4a57a;
    border-radius: 5px;
    background: #fff;
    color: #4f2a10;
    font: inherit;
}

.shop-field input:focus,
.shop-field select:focus {
    outline: none;
    border-color: #b87333;
    box-shadow: 0 0 0 3px rgba(200, 151, 94, 0.23);
}

.shop-field input:disabled {
    background: #eee7e1;
    color: #8d8178;
}

.shop-item-search {
    position: relative;
}

.shop-search-results {
    position: absolute;
    z-index: 30;
    top: calc(100% + 0.2rem);
    right: 0;
    left: 0;
    max-height: 18rem;
    overflow: auto;
    border: 1px solid #c8975e;
    border-radius: 5px;
    background: #fff;
    box-shadow: 0 7px 18px rgba(58, 29, 8, 0.25);
}

.shop-search-results[hidden] {
    display: none;
}

.shop-search-result {
    display: block;
    width: 100%;
    padding: 0.65rem 0.75rem;
    border: 0;
    border-bottom: 1px solid #f0ddcb;
    background: #fff;
    color: #4f2a10;
    text-align: left;
    cursor: pointer;
}

.shop-search-result:last-child {
    border-bottom: 0;
}

.shop-search-result:hover,
.shop-search-result:focus-visible {
    outline: 0;
    background: #fff0df;
}

.shop-search-result strong,
.shop-search-result small {
    display: block;
}

.shop-search-result small {
    margin-top: 0.15rem;
    color: #8a6548;
    overflow-wrap: anywhere;
}

.shop-selected-item {
    min-height: 3.5rem;
    margin-top: 0.55rem;
    padding: 0.55rem;
    border: 1px dashed #c8975e;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.55);
    color: #6b3410;
}

.shop-selected-item img {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    border-radius: 5px;
    object-fit: contain;
    image-rendering: auto;
}

.shop-selected-copy {
    min-width: 0;
}

.shop-selected-copy strong,
.shop-selected-copy small {
    display: block;
    overflow-wrap: anywhere;
}

.shop-selected-copy small {
    color: #8a6548;
}

.shop-check {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    min-height: 2.7rem;
    color: #6b3410;
    font-weight: 700;
}

.shop-check input {
    width: 1.15rem;
    height: 1.15rem;
    accent-color: #c87932;
}

.shop-admin-actions {
    flex-wrap: wrap;
    margin-top: 1rem;
}

.shop-secondary-button,
.shop-danger-button,
.shop-small-button {
    min-height: 2.4rem;
    padding: 0.5rem 0.85rem;
    border: 1px solid #b9875c;
    border-radius: 5px;
    background: linear-gradient(180deg, #fffaf5 0%, #ecd0b5 100%);
    color: #6b3410;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.shop-danger-button {
    border-color: #bc6c62;
    background: linear-gradient(180deg, #fff1ef 0%, #ecc4be 100%);
    color: #7a2119;
}

.shop-secondary-button:hover,
.shop-small-button:hover {
    background: #ffe8d1;
}

.shop-danger-button:hover {
    background: #f6d1cc;
}

.shop-secondary-button:disabled,
.shop-danger-button:disabled,
.shop-small-button:disabled {
    opacity: 0.48;
    cursor: not-allowed;
}

.shop-table-shell {
    overflow-x: auto;
    border: 1px solid #d4a57a;
    border-radius: 7px;
    background: #fff;
}

.shop-offer-table {
    width: 100%;
    min-width: 920px;
    border-collapse: collapse;
    color: #4f2a10;
}

.shop-offer-table th,
.shop-offer-table td {
    padding: 0.65rem 0.55rem;
    border-bottom: 1px solid #ecd7c3;
    text-align: left;
    vertical-align: middle;
}

.shop-offer-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #f4ddc7;
    color: #6b3410;
    white-space: nowrap;
}

.shop-offer-table tr:last-child td {
    border-bottom: 0;
}

.shop-offer-table tr.shop-offer-inactive {
    opacity: 0.63;
}

.shop-offer-name {
    max-width: 250px;
}

.shop-offer-name strong,
.shop-offer-name small {
    display: block;
    overflow-wrap: anywhere;
}

.shop-offer-name small {
    color: #866a53;
}

.shop-table-actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    white-space: nowrap;
}

.shop-empty {
    padding: 2rem 1rem;
    border: 1px dashed #c8975e;
    border-radius: 7px;
    background: #fffaf5;
    color: #6b3410;
    text-align: center;
    line-height: 1.5;
}

.shop-audit-heading {
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.shop-audit-list {
    max-height: 20rem;
    overflow: auto;
    border: 1px solid #e1c4a8;
    border-radius: 6px;
    background: #fff;
}

.shop-audit-entry {
    display: grid;
    grid-template-columns: 7rem 1fr auto;
    gap: 0.75rem;
    padding: 0.65rem 0.75rem;
    border-bottom: 1px solid #efdfd1;
    color: #6b3410;
    font-size: 0.9rem;
}

.shop-audit-entry:last-child {
    border-bottom: 0;
}

.shop-audit-entry time {
    color: #806a57;
    text-align: right;
}

.shop-admin-loading {
    padding: 2rem;
    color: #6b3410;
    text-align: center;
}

@media (max-width: 900px) {
    .shop-admin-grid {
        grid-template-columns: repeat(2, minmax(120px, 1fr));
    }
}

@media (max-width: 600px) {
    .shop-admin-panel {
        padding: 0.85rem;
    }

    .shop-admin-grid {
        grid-template-columns: 1fr;
    }

    .shop-field-wide {
        grid-column: auto;
    }

    .shop-admin-actions > * {
        flex: 1 1 10rem;
    }

    .shop-audit-entry {
        grid-template-columns: 1fr;
        gap: 0.2rem;
    }

    .shop-audit-entry time {
        text-align: left;
    }
}
