:root {
    --bg: #f4f7fb;
    --surface: #ffffff;
    --surface-soft: #f8fafc;
    --text: #172033;
    --muted: #667085;
    --line: #e3e8ef;
    --primary: #1769e0;
    --primary-dark: #0f52ba;
    --shadow: 0 14px 38px rgba(28, 45, 74, .08);
    --radius: 18px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.45;
}

.shell { width: min(1180px, calc(100% - 32px)); margin-inline: auto; }
.topbar {
    background: rgba(255,255,255,.96);
    border-bottom: 1px solid var(--line);
    top: 0;
    z-index: 10;
    backdrop-filter: blur(12px);
}
.topbar-inner {
    min-height: 88px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}
.brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.brand-logo { width: 54px; height: 54px; border-radius: 14px; object-fit: cover; border: 1px solid var(--line); }
.eyebrow { margin: 0 0 2px; color: var(--muted); font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
h1 { margin: 0; font-size: clamp(22px, 3vw, 30px); line-height: 1.1; }
.top-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 16px;
    border-radius: 11px;
    text-decoration: none;
    color: #fff;
    background: var(--primary);
    border: 1px solid var(--primary);
    font-weight: 700;
    font-size: 14px;
    transition: .18s ease;
}
.button:hover { background: var(--primary-dark); transform: translateY(-1px); }
.button-secondary { color: var(--text); background: var(--surface); border-color: var(--line); }
.button-secondary:hover { background: var(--surface-soft); }

.main-content { padding-block: 28px 18px; }
.summary-card {
    display: grid;
    grid-template-columns: 220px minmax(260px, 1fr);
    gap: 24px;
    align-items: end;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 18px;
    box-shadow: var(--shadow);
}
.summary-label { display: block; color: var(--muted); font-size: 13px; margin-bottom: 4px; }
.summary-card strong { font-size: 30px; }
.search-wrap label { display: block; color: var(--muted); font-size: 13px; font-weight: 700; margin-bottom: 7px; }
.search-wrap input {
    width: 100%;
    min-height: 46px;
    border: 1px solid #cfd7e3;
    background: #fff;
    border-radius: 12px;
    padding: 0 14px;
    font: inherit;
    color: var(--text);
    outline: none;
}
.search-wrap input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(23,105,224,.12); }

.catalog-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 720px; }
thead { background: #f6f8fb; }
th {
    text-align: left;
    padding: 14px 16px;
    color: #475467;
    font-size: 12px;
    letter-spacing: .045em;
    text-transform: uppercase;
    border-bottom: 1px solid var(--line);
    background: #f6f8fb;
}
td { padding: 13px 16px; border-bottom: 1px solid #edf0f4; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fbfcfe; }
.image-col { width: 120px; }
.code-col { width: 150px; }
.price-col { width: 190px; text-align: right; }
.product-image-cell { width: 120px; text-align: center; }
.product-image {
    display: block;
    width: 84px;
    height: 64px;
    margin: auto;
    object-fit: contain;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
}
.image-placeholder { display: none; color: #98a2b3; font-size: 12px; }
.product-image-cell:not(:has(.product-image)) .image-placeholder,
.product-image-cell.image-error .image-placeholder { display: inline; }
.code-badge { display: inline-block; padding: 5px 8px; border-radius: 8px; background: #eef4ff; color: #2558a7; font: 700 12px ui-monospace, SFMono-Regular, Menlo, monospace; }
.product-name { font-weight: 650; }
.product-price { text-align: right; font-weight: 800; white-space: nowrap; }
.empty-state { padding: 42px 20px; text-align: center; color: var(--muted); }
.footer { padding: 18px 0 34px; color: var(--muted); text-align: center; font-size: 13px; }

@media (max-width: 720px) {
    .shell { width: min(100% - 20px, 1180px); }
    .topbar { position: static; }
    .topbar-inner { align-items: flex-start; flex-direction: column; padding-block: 14px; }
    .top-actions, .button { width: 100%; }
    .summary-card { grid-template-columns: 1fr; gap: 14px; }
    th { position: static; }
    .main-content { padding-top: 14px; }
}
