/* Каталог товаров — раскладка и отметки. Остальное оформление — общий CSS /assets/ui/v1/.
   Свои классы — с приставкой cat-, чтобы не пересекаться с общими.
   Список и карточка — по образцу «Разрешительных документов» (permits/web/assets/style.css, 01.11.2026):
   таблица во всю ширину, щелчок по строке — карточка выезжает справа. */

/* таблица списка — как реестр РД; без своих полос прокрутки: листается вся страница,
   заголовок столбцов прилипает под общей шапкой (--cat-top ставит app.js по высоте шапки) */
.cat-block { background: #fff; border: 1px solid #e2e6ec; border-radius: 10px; }
/* узкий экран (планшет, телефон): все столбцы не помещаются — таблица листается вбок внутри своего блока, как в РД,
   страница остаётся шириной с экран; на компьютере (от 1280 px) своих полос нет */
@media (max-width: 1279px) { .cat-block { overflow-x: auto; } .cat-block .cat-table thead th { position: static; } }
.cat-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.cat-table th, .cat-table td { padding: 7px 10px; border-bottom: 1px solid #e2e6ec; vertical-align: top; text-align: left; }
.cat-table thead th { position: sticky; top: var(--cat-top, 0px); z-index: 5; background: #fff; color: #6b7482; font-weight: 600;
                      font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }
.cat-table thead th[data-sort] { cursor: pointer; user-select: none; white-space: nowrap; }
.cat-table thead th[data-sort]:hover, .cat-table thead th.cat-sorted { color: #1f5fa8; }
.cat-table .text-right { text-align: right; }
.cat-table td[data-col="manufacturer"] { min-width: 150px; max-width: 260px; overflow-wrap: anywhere; }
.cat-table td[data-col="permits"] { min-width: 190px; }
.cat-table .text-center { text-align: center; }
.cat-table tbody tr { cursor: pointer; }
.cat-table tbody tr:last-child td { border-bottom: 0; }
.cat-table tbody tr:hover td { background: #f7f9fc; }
.cat-table tr.cat-row-danger td { background: #fdecea; }          /* РД истёк */
.cat-table tr.cat-row-danger:hover td { background: #fbdedb; }
.cat-table tr.cat-row-warn td { background: #fff5e0; }            /* РД истекает ≤ 30 дн. */
.cat-table tr.cat-row-warn:hover td { background: #fdefd4; }
.cat-table tr.cat-sel td { background: #e8f0fa; }                 /* открыт в карточке */
.cat-table tr.cat-sel td:first-child { box-shadow: inset 3px 0 0 #1f5fa8; }

/* карточка товара: выезжает справа, как карточка РД */
.cat-drawer { position: fixed; inset: 0; z-index: 50; }
.cat-drawer[hidden] { display: none; }
.cat-drawer-back { position: absolute; inset: 0; background: rgba(20, 26, 36, .45); }
.cat-drawer-panel { position: absolute; top: 0; right: 0; bottom: 0; width: min(760px, 96vw); background: #fff;
                    box-shadow: -8px 0 30px rgba(0, 0, 0, .18); overflow: auto; padding: 22px 26px 60px; }
.cat-drawer-close { position: absolute; top: 12px; right: 16px; border: 0; background: transparent; font-size: 26px;
                    line-height: 1; color: #6b7482; cursor: pointer; }
.cat-drawer-close:hover { color: #1c2230; }
.cat-drawer-head { display: flex; align-items: center; gap: 10px; margin: 0 36px 12px 0; color: #6b7482; font-size: 13px; }
.cat-drawer-nav { margin-left: auto; display: flex; gap: 4px; }
.cat-drawer-nav button { border: 1px solid #e2e6ec; background: #fff; border-radius: 8px; padding: 2px 10px; cursor: pointer; }
.cat-drawer-nav button:disabled { opacity: .35; cursor: default; }
.cat-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 14px; }
/* телефон: карточка во весь экран (от левого края — так она на экране, даже если что-то растянет страницу шире) */
@media (max-width: 760px) { .cat-drawer-panel { left: 0; right: auto; width: 100vw; padding: 16px 14px 60px; } }

/* быстрые фильтры со счётчиками */
.cat-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.cat-chip { height: 34px; padding: 0 12px; border-radius: 999px; border: 1px solid #cbd5e1; background: #fff;
            color: #0f172a; font-size: 13px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.cat-chip b { font-weight: 700; }
.cat-chip:hover { border-color: #1d4ed8; }
.cat-chip-on { background: #1d4ed8; border-color: #1d4ed8; color: #fff; }
.cat-chip-warn { border-color: #f59e0b; background: #fffbeb; color: #78350f; }
.cat-chip-warn.cat-chip-on { background: #b45309; border-color: #b45309; color: #fff; }

.cat-mono { font-family: ui-monospace, "JetBrains Mono", Consolas, monospace; letter-spacing: .02em; }
.cat-stp { font-weight: 700; font-size: 15px; font-variant-numeric: tabular-nums; }

/* «паспорт» товара */
.cat-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 16px; }
.cat-code { font-family: ui-monospace, "JetBrains Mono", Consolas, monospace; font-size: 21px; font-weight: 600; }
.cat-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.cat-tiles-4 { display: grid; grid-template-columns: repeat(4, minmax(110px, 1fr)); gap: 8px; }
@media (max-width: 700px) { .cat-tiles-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.cat-tile { background: #f8fafc; border-radius: 10px; padding: 10px 12px; }
.cat-tile-label { color: #475569; font-size: 12px; }
.cat-tile-big { font-size: 24px; font-weight: 700; line-height: 1.15; font-variant-numeric: tabular-nums; }
.cat-tile-mid { font-size: 17px; font-weight: 700; line-height: 1.2; }
.cat-tile-sub { color: #475569; font-size: 12px; margin-top: 2px; }
.cat-tile-ett { background: #e8effd; } .cat-tile-ett .cat-tile-mid { color: #1e3a8a; }
.cat-tile-nocert { background: #fde7d7; } .cat-tile-nocert .cat-tile-mid, .cat-tile-nocert .cat-tile-sub { color: #8a2c0d; }
.cat-tile-warn { background: #fef3c7; } .cat-tile-warn .cat-tile-mid, .cat-tile-warn .cat-tile-sub { color: #78350f; }
.cat-tile-bad { background: #fde2e1; } .cat-tile-bad .cat-tile-mid, .cat-tile-bad .cat-tile-sub { color: #9b1c1c; }
.cat-tile-ok { background: #dcf2e4; } .cat-tile-ok .cat-tile-mid, .cat-tile-ok .cat-tile-sub { color: #0f5132; }
.cat-h { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: #475569; font-weight: 600; margin: 14px 0 6px; }
.cat-btn { height: 40px; padding: 0 14px; border-radius: 10px; border: 1px solid #cbd5e1; background: #fff; color: #0f172a;
           font-size: 14px; cursor: pointer; }
.cat-btn-primary { background: #1d4ed8; border-color: #1d4ed8; color: #fff; font-weight: 600; }
.cat-need { display: block; width: 100%; text-align: left; margin-top: 10px; padding: 8px 10px; border-radius: 8px;
            border: 1px solid #fcd34d; background: #fffbeb; color: #78350f; font-size: 13px; cursor: pointer; }
.cat-empty { color: #64748b; text-align: center; padding: 32px 8px; font-size: 14px; }

/* шапка карточки в окне */
.cat-passport { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; margin-bottom: 14px; }
.cat-passport-main { flex: 1 1 320px; min-width: 0; }
.cat-passport-tiles { flex: 1 1 460px; }

/* окно (журнал, импорт, обновление ставок) */
.cat-modal { max-width: 960px; }
