/* ======================================================================
   Сметы и КП — светлая «строительная» тема
   Тёплый светлый фон, спокойный текст, оранжевый акцент.
   ====================================================================== */
:root {
    --bg: #f4f2ee;
    --surface: #ffffff;
    --surface-2: #faf8f4;
    --border: #e8e2d9;
    --border-strong: #d8d0c3;
    --text: #1f1b16;
    --text-2: #4b443c;
    --muted: #8a8175;
    --accent: #ea580c;
    --accent-hover: #c2410c;
    --accent-soft: #fff4ec;
    --ok: #15803d;     --ok-soft: #e6f6ea;
    --warn: #b45309;   --warn-soft: #fdf0d5;
    --danger: #dc2626; --danger-soft: #fdeaea;
    --radius: 10px;
    --shadow-sm: 0 1px 2px rgba(31, 27, 22, 0.06);
    --shadow: 0 6px 20px rgba(31, 27, 22, 0.08);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Шапка ---------- */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    height: 60px;
    padding: 0 24px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 20;
}
.topbar .brand {
    display: flex;
    align-items: center;
    gap: 11px;
    font-weight: 700;
    font-size: 17px;
    letter-spacing: -0.01em;
    color: var(--text);
}
.topbar .brand:hover { text-decoration: none; }
.topbar .brand::before {
    content: "";
    width: 26px;
    height: 26px;
    border-radius: 7px;
    background: linear-gradient(135deg, #f59e0b, var(--accent));
    box-shadow: 0 2px 7px rgba(234, 88, 12, 0.4);
}
.topbar nav { display: flex; align-items: center; gap: 6px; }
.topbar nav a {
    color: var(--text-2);
    padding: 8px 13px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
}
.topbar nav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.topbar nav a.btn-primary { color: #fff; }
.topbar nav a.btn-primary:hover { color: #fff; }

.container { max-width: 1120px; margin: 0 auto; padding: 28px 24px 64px; }

/* ---------- Заголовки страниц ---------- */
.page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 22px;
    flex-wrap: wrap;
}
.page-head h1 { margin: 0; font-size: 24px; font-weight: 700; letter-spacing: -0.02em; }
.page-head .actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.page-head form { margin: 0; }
h2 { font-size: 16px; font-weight: 600; margin: 30px 0 12px; }

/* ---------- Кнопки ---------- */
.btn, .btn-primary, .btn-danger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 15px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.2;
    border: 1px solid var(--border-strong);
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.btn:hover { background: var(--surface-2); border-color: var(--muted); text-decoration: none; }
.btn-primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    box-shadow: 0 1px 2px rgba(234, 88, 12, 0.3);
}
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; text-decoration: none; }
.btn-danger { color: var(--danger); border-color: #eebcbc; background: var(--surface); }
.btn-danger:hover { background: var(--danger-soft); border-color: var(--danger); text-decoration: none; }

/* ---------- Сообщения ---------- */
.flash { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 18px; border: 1px solid; font-size: 14px; }
.flash.ok  { background: var(--ok-soft);     border-color: #bfe6c8; color: #14532d; }
.flash.err { background: var(--danger-soft);  border-color: #f3c2c2; color: #991b1b; }

.empty {
    color: var(--muted);
    padding: 32px;
    text-align: center;
    background: var(--surface);
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius);
}
.empty a { font-weight: 600; }

/* ---------- Таблицы ---------- */
.table-wrap {
    overflow-x: auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}
.grid { width: 100%; border-collapse: collapse; background: var(--surface); font-size: 14px; }
.grid th, .grid td { padding: 11px 14px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
.grid thead th {
    background: var(--surface-2);
    color: var(--muted);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
}
/* липкая шапка таблицы позиций: прокручивается вся страница, заголовки колонок остаются под шапкой сайта */
.table-wrap.sticky-head { overflow: visible; }
.table-wrap.sticky-head .grid thead th {
    position: sticky;
    top: 60px; /* высота .topbar */
    z-index: 5;
    box-shadow: inset 0 -1px 0 var(--border);
}
/* на узких экранах возвращаем горизонтальную прокрутку (липкость при этом отключается) */
@media (max-width: 760px) {
    .table-wrap.sticky-head { overflow-x: auto; }
    .table-wrap.sticky-head .grid thead th { position: static; }
}
.grid tbody tr:last-child td { border-bottom: none; }
.grid tbody tr:hover { background: #eef1f6; } /* нейтральный ховер, не путать с материалом */
.grid .r { text-align: right; font-variant-numeric: tabular-nums; }
.grid tfoot td { background: var(--surface-2); font-size: 15px; border-top: 2px solid var(--border-strong); border-bottom: none; }
.grid a { font-weight: 500; }
.grid tbody tr.kind-head td { background: var(--accent); color: #fff; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; font-size: 13px; }
.grid tbody tr.kind-head:hover td { background: var(--accent); }
.grid tbody tr.kind-total td { background: var(--accent-soft); font-weight: 700; border-top: 1px solid var(--border-strong); }
.grid tbody tr.kind-total:hover td { background: var(--accent-soft); }
.grid tbody tr.grp td { background: var(--accent-soft); font-weight: 700; letter-spacing: 0.01em; }
.grid tbody tr.grp:hover td { background: var(--accent-soft); }
.grid tbody tr.subgrp td { background: var(--surface-2); font-style: italic; color: var(--muted); padding-left: 28px; }
.grid tbody tr.subgrp:hover td { background: var(--surface-2); }
.grid tbody tr.grp-total td { background: var(--surface-2); font-weight: 600; }
.grid tbody tr.grp-total:hover td { background: var(--surface-2); }
.grid .nowrap { white-space: nowrap; }
.inline-form { display: inline; margin: 0; }
.link-danger {
    background: none; border: none; padding: 0; margin-left: 12px;
    color: var(--danger); font: inherit; cursor: pointer; text-decoration: underline;
}
.link-danger:hover { color: #991b1b; }
p.sub { color: var(--muted); font-size: 14px; margin: 0 0 18px; max-width: 720px; }
.filters {
    display: flex; align-items: flex-end; flex-wrap: wrap; gap: 14px;
    background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
    padding: 14px 16px; margin-bottom: 18px;
}
.filters label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--muted); font-weight: 600; }
.filters select {
    min-width: 200px; padding: 8px 10px; font-size: 14px;
    border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text);
}
.filters .btn, .filters .btn-primary { margin-bottom: 0; }

/* ---------- Бейджи статусов ---------- */
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge.s-draft    { background: #efece6; color: #6b6358; }
.badge.s-review   { background: var(--warn-soft); color: #92400e; }
.badge.s-approved { background: var(--ok-soft);   color: #166534; }

/* ---------- Карточка реквизитов ---------- */
.meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    margin-bottom: 8px;
}
.meta div { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; background: var(--surface); }
.meta span { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; }
.meta b { color: var(--text); font-weight: 600; }

/* ---------- Форма ---------- */
.form .fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
}
.form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 500; color: var(--text-2); }
.form .f-wide { grid-column: 1 / -1; }
.form input, .form select {
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    color: var(--text);
    padding: 9px 11px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.form input:focus, .form select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* ---------- Таблица позиций ---------- */
.items input {
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    padding: 7px 9px;
    font-size: 14px;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.items input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
/* раздвигающаяся ячейка («Раздел», «Код», «Наименование») при редактировании строки, где значение уже есть */
#items tbody td:nth-child(2),
#items tbody td:nth-child(3),
#items tbody td:nth-child(4) { position: relative; }
#items input.name-expand {
    position: absolute;
    top: 11px;
    left: 14px;
    width: min(62vw, 920px);
    z-index: 30;
    background: var(--surface);
    border-color: var(--accent);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
}
/* «Раздел» и «Код» обычно короче — раздвигаем поскромнее */
#items input[name="section[]"].name-expand,
#items input[name="code[]"].name-expand { width: min(44vw, 560px); }
.items .num { text-align: right; font-variant-numeric: tabular-nums; }
.items td.amount { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.items td.pos { color: var(--muted); text-align: center; font-variant-numeric: tabular-nums; }
.items .c-pos  { width: 44px; }
.items .c-unit { width: 72px; }
.items .c-num  { width: 120px; }
.items .c-coef { width: 84px; }
.items .c-del  { width: 42px; }
.btn-del {
    background: transparent;
    border: none;
    color: var(--muted);
    cursor: pointer;
    font-size: 15px;
    line-height: 1;
    padding: 6px 8px;
    border-radius: 6px;
    transition: background 0.15s, color 0.15s;
}
.btn-del:hover { color: var(--danger); background: var(--danger-soft); }

.form-actions { display: flex; gap: 12px; margin-top: 24px; }

/* ---------- Совместный доступ ---------- */
.share-box {
    background: var(--accent-soft);
    border: 1px solid #f3cda9;
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 20px;
}
.share-label { font-weight: 600; margin-bottom: 10px; }
.share-row { display: flex; gap: 8px; }
.share-row input {
    flex: 1;
    min-width: 0;
    background: #fff;
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    padding: 9px 11px;
    font-size: 13px;
    color: var(--text-2);
    font-family: inherit;
}
.share-hint { color: var(--muted); font-size: 12px; margin-top: 10px; }
.share-banner {
    background: var(--accent-soft);
    border: 1px solid #f3cda9;
    border-radius: var(--radius);
    padding: 11px 15px;
    margin-bottom: 20px;
    font-size: 14px;
    color: #7c3a0c;
}

/* ---------- Навигация: пользователь ---------- */
.nav-user { color: var(--muted); font-size: 13px; padding: 0 4px 0 10px; text-decoration: none; }
.nav-user:hover { color: var(--text); text-decoration: underline; }
.account-h2 { font-size: 16px; margin: 26px 0 14px; padding-top: 18px; border-top: 1px solid var(--border); }

/* ---------- Авторизация ---------- */
.auth { max-width: 420px; margin: 40px auto; }
.auth-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 28px;
}
.auth-card h1 { font-size: 22px; margin: 0 0 6px; }
.auth-card .sub { color: var(--muted); margin: 0 0 20px; font-size: 14px; }
.auth-card label { display: block; font-size: 13px; font-weight: 500; color: var(--text-2); margin-bottom: 6px; }
.auth-card input[type=email],
.auth-card input[type=password] {
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 14px;
    margin-bottom: 16px;
    font-family: inherit;
}
.auth-card input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.auth-card .btn-primary { width: 100%; justify-content: center; }
.auth-card .alt { margin: 16px 0 0; font-size: 14px; color: var(--muted); text-align: center; }

/* ---------- Предупреждение / быстрое сохранение ---------- */
.flash.warn { background: var(--warn-soft); border-color: #f3dca0; color: #92400e; }

.save-anon {
    margin-top: 24px;
    background: var(--accent-soft);
    border: 1px solid #f3cda9;
    border-radius: var(--radius);
    padding: 18px 20px;
}
.save-anon-title { font-weight: 700; font-size: 16px; margin-bottom: 4px; }
.save-anon-hint { color: var(--text-2); font-size: 14px; margin: 0 0 14px; }
.save-anon-row { display: flex; gap: 10px; flex-wrap: wrap; }
.save-anon-row input {
    flex: 1; min-width: 220px;
    background: #fff;
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 14px;
    font-family: inherit;
}
.save-anon-row input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.save-anon-alt { margin: 12px 0 0; font-size: 13px; color: var(--muted); }
.save-anon-preview {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px dashed #f0cba0;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 13px;
    color: var(--muted);
}

/* ---------- Главная (лендинг) ---------- */
.btn-lg { padding: 13px 26px; font-size: 16px; border-radius: 10px; }

.hero { text-align: center; padding: 48px 16px 36px; max-width: 760px; margin: 0 auto; }
.hero-title { font-size: 38px; line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 18px; color: var(--text); }
.hero-sub { font-size: 18px; color: var(--text-2); margin: 0 auto 28px; max-width: 620px; }
.hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.hero-note { margin-top: 18px; font-size: 14px; color: var(--muted); }

.features {
    display: grid;
    /* Ровно 3 колонки: 6 карточек ложатся симметрично 3+3, без «висящего» ряда. */
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin: 24px 0;
}
@media (max-width: 880px) {
    /* Планшет: 2+2+2 — тоже симметрично. */
    .features { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
    /* Телефон: одна колонка. */
    .features { grid-template-columns: 1fr; }
}
.feature {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
    box-shadow: var(--shadow-sm);
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.feature:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 18px rgba(31, 27, 22, 0.10);
    border-color: var(--border-strong);
}
.feature-ico { font-size: 28px; margin-bottom: 10px; }
.feature h3 { margin: 0 0 6px; font-size: 16px; }
.feature p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }

.steps {
    text-align: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 36px 24px;
    margin: 24px 0 12px;
    box-shadow: var(--shadow-sm);
}
.steps-title { margin: 0 0 20px; font-size: 22px; }
.steps-list {
    display: inline-block;
    text-align: left;
    max-width: 520px;
    margin: 0 auto 24px;
    color: var(--text-2);
    line-height: 1.9;
    padding-left: 22px;
}

@media (max-width: 600px) {
    .hero-title { font-size: 30px; }
    .hero-sub { font-size: 16px; }
}

/* ---------- Справочник ---------- */
.catalog-intro { color: var(--muted); font-size: 14px; margin: -8px 0 24px; max-width: 720px; }
.cat-h-0 { font-size: 20px; margin: 32px 0 12px; padding-bottom: 8px; border-bottom: 2px solid var(--accent); display: inline-block; }
.cat-h-1 { font-size: 15px; color: var(--text-2); margin: 18px 0 8px; }
.muted-code { color: var(--muted); font-size: 13px; white-space: nowrap; }

/* ---------- Управление справочником ---------- */
.manage-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}
.card-form {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 20px;
}
.card-form-wide { max-width: 560px; }
.card-form h2 { margin: 0 0 14px; font-size: 16px; }
.card-form label { display: block; font-size: 13px; font-weight: 500; color: var(--text-2); margin-bottom: 12px; }
.card-form input, .card-form select {
    display: block;
    width: 100%;
    margin-top: 5px;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    padding: 9px 11px;
    font-size: 14px;
    font-family: inherit;
}
.card-form input:focus, .card-form select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.card-form .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.card-form .hint { font-size: 12px; color: var(--muted); margin: -4px 0 14px; }

.mng-cat { margin-bottom: 18px; }
.mng-cat-h { display: flex; align-items: center; gap: 8px; }
.mng-cat-h form { margin: 0; }
.mng-actions { white-space: nowrap; }
.mng-actions form { display: inline; margin: 0 0 0 8px; }
.link-del {
    background: none; border: none; color: var(--muted);
    cursor: pointer; font-size: 13px; padding: 2px 5px; border-radius: 5px;
}
.link-del:hover { color: var(--danger); background: var(--danger-soft); }

/* ---------- Мои цены ---------- */
.price-inp {
    width: 120px;
    text-align: right;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: 6px;
    padding: 7px 9px;
    font-size: 14px;
    font-family: inherit;
    font-variant-numeric: tabular-nums;
}
.price-inp:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.my-prices-actions {
    position: sticky;
    bottom: 0;
    display: flex;
    gap: 12px;
    padding: 14px 0;
    margin-top: 8px;
    background: linear-gradient(to top, var(--bg) 72%, rgba(244, 242, 238, 0));
}

/* ---------- НДС ---------- */
.vat-summary, .totals-box {
    margin: 16px 0 8px auto;
    max-width: 380px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 18px;
    box-shadow: var(--shadow-sm);
}
.vat-row, .t-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 4px 0;
    font-size: 14px;
    color: var(--text-2);
}
.vat-row.vat-total, .t-row.t-total {
    border-top: 1px solid var(--border);
    margin-top: 6px;
    padding-top: 10px;
    font-size: 16px;
    color: var(--text);
    font-weight: 600;
}
.vat-row b, .t-row b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.field-note { margin: 6px 0 0; font-size: 13px; color: var(--text-2); }

/* ---------- Автоподсказки наименования (база ГЭСН) ---------- */
.name-ac {
    position: absolute;
    z-index: 1000;
    max-height: 320px;
    max-width: 560px;
    overflow-y: auto;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}
.name-ac-item { padding: 7px 12px; cursor: pointer; border-bottom: 1px solid var(--border); }
.name-ac-item:last-child { border-bottom: none; }
.name-ac-item:hover, .name-ac-item.active { background: var(--accent-soft); }
.name-ac-name { font-size: 13px; color: var(--text); line-height: 1.3; }
.name-ac-meta { font-size: 11px; color: var(--text-2); margin-top: 2px; }

/* ---------- Переключатель Работы/Материалы в справочнике ---------- */
.kind-tabs { display: flex; gap: 8px; margin: 0 0 16px; }
.kind-tab {
    padding: 7px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text-2);
    text-decoration: none;
    font-size: 14px;
}
.kind-tab:hover { border-color: var(--border-strong); }
.kind-tab.active { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 600; }
.cat-empty { padding: 14px; color: var(--text-2); font-size: 14px; }

/* ---------- Пикер каталога (модальное окно) ---------- */
.items-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-sm { padding: 6px 12px; font-size: 13px; }

.modal { display: none; position: fixed; inset: 0; z-index: 100; }
.modal.open { display: block; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(28, 25, 23, 0.45); }
.modal-box {
    position: relative;
    max-width: 660px;
    margin: 5vh auto;
    background: var(--surface);
    border-radius: 12px;
    box-shadow: var(--shadow);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.modal-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.modal-head h3 { margin: 0; font-size: 17px; }
.modal-close { background: none; border: none; font-size: 18px; cursor: pointer; color: var(--muted); padding: 4px 8px; border-radius: 6px; }
.modal-close:hover { background: var(--surface-2); color: var(--text); }
#catalog-search {
    margin: 14px 20px 8px;
    padding: 10px 12px;
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
}
#catalog-search:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.catalog-list { overflow-y: auto; padding: 4px 10px 14px; }
.cat-item {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 10px 12px; border-radius: 8px;
}
.cat-item:hover { background: var(--surface-2); }
.cat-item-title { font-size: 14px; color: var(--text); }
.cat-item-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.cat-item-right { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.cat-item-price { font-size: 13px; color: var(--text-2); font-variant-numeric: tabular-nums; }

/* поиск материалов — как поиск в каталоге */
#material-search {
    margin: 14px 20px 8px;
    padding: 10px 12px;
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
}
#material-search:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* тег «есть норма ГЭСН» в пикере работ */
.cat-gesn-tag {
    font-size: 11px; color: var(--accent); border: 1px solid var(--accent);
    border-radius: 4px; padding: 1px 6px;
}

/* строки-материалы в таблице позиций (тёплый оттенок; ховер — чуть насыщеннее) */
.grid tbody tr.mat-row { background: var(--accent-soft); }
.grid tbody tr.mat-row:hover { background: #ffe7d6; }
.grid tr.mat-row td:nth-child(4) input { font-style: italic; }
.grid tr.mat-row .pos::after { content: " М"; color: var(--accent); font-size: 11px; }
.btn-del.gesn-btn { color: var(--accent); font-size: 15px; }
.btn-del.gesn-btn:hover { color: var(--accent); }
