:root {
    --bg: #f4f6f8;
    --surface: #ffffff;
    --surface-soft: #eef2f5;
    --text: #1d2730;
    --muted: #66737f;
    --line: #dbe1e6;
    --accent: #6f3cff;
    --accent-dark: #5326d8;
    --danger: #b42318;
    --shadow: 0 12px 35px rgba(20, 31, 41, 0.08);
    font-family: Inter, "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body { margin: 0; color: var(--text); background: var(--bg); }
a { color: var(--accent-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
    min-height: 62px;
    padding: 0 28px;
    display: flex;
    align-items: center;
    gap: 28px;
    background: #17202a;
    color: #fff;
    box-shadow: 0 3px 12px rgba(0,0,0,.18);
}
.brand { color: #fff; font-weight: 800; font-size: 20px; letter-spacing: .02em; }
.brand:hover { text-decoration: none; }
.topnav { display: flex; gap: 18px; }
.topnav a { color: #dfe6ec; }
.user-panel { margin-left: auto; display: flex; align-items: center; gap: 16px; font-size: 14px; }
.client-name { padding: 5px 9px; border-radius: 999px; background: rgba(255,255,255,.12); }
.link-button { border: 0; padding: 0; background: none; color: #fff; cursor: pointer; font: inherit; }

.page { width: min(1560px, calc(100% - 32px)); margin: 28px auto 60px; }
.footer { padding: 18px; text-align: center; color: var(--muted); font-size: 13px; }

.page-heading, .section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; }
h1 { margin: 5px 0 8px; font-size: clamp(28px, 4vw, 42px); line-height: 1.08; }
h2 { margin: 0 0 18px; font-size: 24px; }
p { line-height: 1.55; }
.eyebrow { text-transform: uppercase; letter-spacing: .13em; font-size: 12px; font-weight: 800; color: var(--accent); }
.muted { color: var(--muted); }

.filter-panel {
    margin: 22px 0;
    padding: 18px;
    display: flex;
    align-items: end;
    gap: 12px;
    flex-wrap: wrap;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: var(--shadow);
}
.field { display: grid; gap: 6px; min-width: 180px; }
.field.grow { flex: 1 1 340px; }
.field.compact { min-width: 130px; }
label { font-size: 13px; font-weight: 700; color: #46535e; }
input, select {
    min-height: 42px;
    padding: 9px 11px;
    border: 1px solid #cbd3da;
    border-radius: 9px;
    background: #fff;
    color: var(--text);
    font: inherit;
}
input:focus, select:focus { outline: 3px solid rgba(111,60,255,.15); border-color: var(--accent); }

.primary-button, .secondary-button {
    min-height: 42px;
    padding: 10px 17px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    border: 1px solid transparent;
    font-weight: 800;
    cursor: pointer;
}
.primary-button { background: var(--accent); color: #fff; }
.primary-button:hover { background: var(--accent-dark); text-decoration: none; }
.secondary-button { background: #fff; color: var(--text); border-color: var(--line); }
.inline { width: fit-content; }

.table-card, .content-section, .message-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: var(--shadow);
}
.table-scroll { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table th { padding: 12px; text-align: left; background: var(--surface-soft); border-bottom: 1px solid var(--line); white-space: nowrap; }
.data-table td { padding: 10px 12px; border-bottom: 1px solid #edf0f2; vertical-align: middle; }
.data-table tbody tr:hover { background: #faf9ff; }
.product-thumb { width: 58px; height: 76px; object-fit: cover; border-radius: 7px; background: #eee; }
.article-link { font-weight: 800; }
.empty-cell { text-align: center; padding: 34px !important; color: var(--muted); }

.pager { margin-top: 20px; display: flex; flex-wrap: wrap; gap: 7px; justify-content: center; }
.pager a { min-width: 38px; padding: 8px 11px; text-align: center; background: #fff; border: 1px solid var(--line); border-radius: 8px; }
.pager a.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.pager a.disabled { pointer-events: none; opacity: .42; }

.login-shell { min-height: calc(100vh - 170px); display: grid; place-items: center; }
.login-card { width: min(440px, 100%); padding: 34px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); }
.login-title { margin-bottom: 26px; }
.form-grid { display: grid; gap: 10px; }
.checkbox-row { display: flex; align-items: center; gap: 8px; margin: 8px 0; }
.checkbox-row input { min-height: auto; }
.validation { color: var(--danger); font-size: 13px; }

.back-link { display: inline-block; margin-bottom: 18px; }
.product-hero { padding: 25px; display: grid; grid-template-columns: minmax(240px, 390px) 1fr; gap: 34px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); }
.product-main-image { min-height: 420px; display: grid; place-items: center; background: var(--surface-soft); border-radius: 12px; overflow: hidden; }
.product-main-image img { width: 100%; height: 100%; max-height: 560px; object-fit: contain; }
.image-placeholder { color: var(--muted); }
.lead { color: #42505b; white-space: pre-line; }
.details-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 13px; }
.details-grid div { padding: 11px; background: var(--surface-soft); border-radius: 9px; }
.details-grid dt { color: var(--muted); font-size: 12px; }
.details-grid dd { margin: 5px 0 0; font-weight: 700; }
.content-section { margin-top: 22px; padding: 24px; }
.compact-details { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.section-heading span { padding: 4px 9px; color: var(--muted); background: var(--surface-soft); border-radius: 999px; }
.photo-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.photo-gallery a { display: block; height: 220px; border-radius: 10px; overflow: hidden; background: var(--surface-soft); }
.photo-gallery img { width: 100%; height: 100%; object-fit: cover; }
.characteristics-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1px 24px; }
.characteristic-row { padding: 10px 0; display: flex; gap: 15px; justify-content: space-between; border-bottom: 1px solid #edf0f2; }
.characteristic-row span { color: var(--muted); }
.characteristic-row strong { text-align: right; }
.tag-list { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-chip { padding: 7px 11px; border-radius: 999px; background: #efeaff; color: #4f26bd; font-weight: 700; }
.message-card { max-width: 700px; margin: 70px auto; padding: 32px; }
code { font-family: Consolas, monospace; }

@media (max-width: 880px) {
    .topbar { padding: 12px 16px; flex-wrap: wrap; gap: 14px; }
    .user-panel { width: 100%; margin-left: 0; }
    .page { width: min(100% - 18px, 1560px); margin-top: 16px; }
    .product-hero { grid-template-columns: 1fr; padding: 16px; }
    .product-main-image { min-height: 300px; }
}
