* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: #f5f6f8;
    color: #20242a;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
    color: #1769aa;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.shell {
    width: min(1180px, calc(100% - 32px));
    margin: 32px auto;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

.page-header h1 {
    margin: 0 0 6px;
    font-size: 28px;
    line-height: 1.2;
}

.page-header p {
    margin: 0;
    color: #68717d;
}

.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.search-form {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

input,
select,
button {
    height: 40px;
    border: 1px solid #cfd5dd;
    border-radius: 6px;
    background: #fff;
    color: #20242a;
    font: inherit;
}

input,
select {
    padding: 0 12px;
}

input[type="search"] {
    width: min(360px, 100%);
}

button {
    padding: 0 14px;
    cursor: pointer;
}

.button-link,
.primary-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    padding: 0 14px;
    border: 1px solid #cfd5dd;
    border-radius: 6px;
    background: #fff;
    color: #20242a;
    text-decoration: none;
    white-space: nowrap;
}

.button-link:hover,
.primary-link:hover {
    text-decoration: none;
}

.primary-button {
    border-color: #0b6bcb;
    background: #0b6bcb;
    color: #fff;
    font-weight: 600;
}

.primary-link {
    border-color: #0b6bcb;
    background: #0b6bcb;
    color: #fff;
    font-weight: 600;
}

.danger-button {
    border-color: #d7a7a7;
    background: #fff;
    color: #b42318;
}

.text-link {
    display: inline-flex;
    align-items: center;
    height: 40px;
}

.count {
    color: #68717d;
    white-space: nowrap;
}

.header-actions,
.row-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.alert {
    margin-bottom: 16px;
    padding: 12px 14px;
    border-radius: 6px;
}

.alert-success {
    border: 1px solid #b9dec9;
    background: #eef9f2;
    color: #166534;
}

.alert-error {
    border: 1px solid #f0b8b8;
    background: #fff1f1;
    color: #b42318;
}

.table-wrap {
    overflow-x: auto;
    border: 1px solid #dde2e8;
    border-radius: 8px;
    background: #fff;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 980px;
}

th,
td {
    padding: 12px;
    border-bottom: 1px solid #edf0f3;
    text-align: left;
    vertical-align: middle;
}

th {
    background: #fafbfc;
    color: #4d5966;
    font-size: 13px;
    font-weight: 700;
}

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

.image-cell {
    width: 92px;
}

.image-cell img,
.image-placeholder {
    width: 68px;
    height: 68px;
    border-radius: 6px;
    object-fit: cover;
}

.image-placeholder {
    display: grid;
    place-items: center;
    background: #edf0f3;
    color: #7b8490;
    font-size: 13px;
}

.title-cell {
    min-width: 280px;
    max-width: 520px;
    line-height: 1.45;
}

.code-cell {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    white-space: nowrap;
}

.price-cell,
.date-cell {
    white-space: nowrap;
}

.price-cell {
    text-align: right;
}

.empty {
    padding: 40px 12px;
    color: #68717d;
    text-align: center;
}

.copy-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 20px;
}

.copy-main,
.copy-side {
    border: 1px solid #dde2e8;
    border-radius: 8px;
    background: #fff;
    padding: 16px;
}

.copy-side h2 {
    margin: 0 0 12px;
    font-size: 18px;
}

.field-group {
    display: grid;
    gap: 8px;
    margin-bottom: 16px;
}

.field-group label {
    color: #4d5966;
    font-size: 13px;
    font-weight: 700;
}

.field-group textarea {
    width: 100%;
    min-height: 120px;
    padding: 12px;
    border: 1px solid #cfd5dd;
    border-radius: 6px;
    font: inherit;
    resize: vertical;
}

.copy-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
}

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

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

.copy-images img {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 6px;
    object-fit: cover;
}

@media (max-width: 700px) {
    .shell {
        width: min(100% - 20px, 1180px);
        margin: 20px auto;
    }

    .page-header,
    .toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .primary-button,
    .header-actions,
    .search-form,
    input[type="search"],
    select,
    .search-form button {
        width: 100%;
    }

    .copy-layout,
    .field-grid {
        grid-template-columns: 1fr;
    }
}
