/* Поисковик закупок: список и выезжающая карточка закупки. */
:root {
  --z-bg: #f2f4f7; --z-panel: #fff; --z-ink: #1f2937; --z-muted: #6b7686; --z-faint: #9aa4b2;
  --z-line: #e4e8ee; --z-hover: #f4f8fd; --z-active: #e9f1fc; --z-accent: #1f6fd6; --z-accent-soft: #e8f0fc;
  --z-green: #1d9a53; --z-green-soft: #e6f5ec; --z-red: #d23f3f; --z-red-soft: #fdecec; --z-amber: #b86e00; --z-amber-soft: #fff3df;
  --z-radius: 10px; --z-shadow: 0 10px 40px rgba(15, 23, 42, .18);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--z-bg); color: var(--z-ink); font: 14px/1.4 Inter, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--z-accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; }
.z-muted { color: var(--z-muted); }

/* --- Шапка --- */
.z-top { position: sticky; top: 0; z-index: 30; background: #fff; border-bottom: 1px solid var(--z-line); }
.z-top-inner { display: flex; align-items: center; gap: 16px; max-width: 1480px; margin: 0 auto; padding: 8px 20px; }
.z-brand { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--z-ink); font-size: 16px; }
.z-brand:hover { text-decoration: none; }
.z-brand-mark { width: 28px; height: 28px; border-radius: 8px; background: var(--z-accent); color: #fff; display: grid; place-items: center; }
.z-user { margin-left: auto; display: flex; align-items: center; gap: 14px; color: var(--z-muted); font-size: 13px; }
.z-user form { margin: 0; }
.z-link-btn { border: 0; background: none; color: var(--z-muted); cursor: pointer; padding: 4px 6px; border-radius: 6px; }
.z-link-btn:hover { background: var(--z-bg); color: var(--z-ink); }
.z-page { max-width: 1480px; margin: 0 auto; padding: 16px 20px 40px; }

/* --- Раскладка списка --- */
.z-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 16px; align-items: start; }
.z-side { position: sticky; top: 64px; background: #fff; border-radius: var(--z-radius); padding: 10px 0; max-height: calc(100vh - 80px); overflow-y: auto; }
.z-facet { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 6px 16px; color: var(--z-ink); border-left: 3px solid transparent; }
.z-facet:hover { background: var(--z-hover); text-decoration: none; }
.z-facet.on { border-left-color: var(--z-accent); background: var(--z-active); font-weight: 600; }
.z-facet span, .z-check span { color: var(--z-faint); font-size: 13px; font-weight: 400; }
.z-facet-title { padding: 14px 16px 4px; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--z-faint); }
.z-check { display: flex; align-items: center; gap: 8px; padding: 5px 16px; cursor: pointer; }
.z-check span { margin-left: auto; }
.z-check input { accent-color: var(--z-accent); }
.z-more { border-top: 1px solid var(--z-line); margin-top: 10px; }
.z-more summary { padding: 12px 16px; cursor: pointer; color: var(--z-accent); list-style: none; }
.z-more summary::-webkit-details-marker { display: none; }
.z-more-body { padding: 0 16px 12px; display: grid; gap: 10px; }
.z-field label { display: block; font-size: 12px; color: var(--z-muted); margin-bottom: 3px; }
.z-input, .z-select { width: 100%; border: 1px solid var(--z-line); border-radius: 7px; padding: 6px 9px; background: #fff; color: var(--z-ink); font: inherit; }
.z-input:focus, .z-select:focus { outline: 2px solid var(--z-accent-soft); border-color: var(--z-accent); }
.z-pair { display: flex; gap: 6px; }
.z-btn { border: 0; border-radius: 7px; padding: 7px 14px; background: var(--z-accent); color: #fff; cursor: pointer; font-weight: 600; }
.z-btn:hover { filter: brightness(1.05); }
.z-btn-ghost { background: transparent; color: var(--z-muted); font-weight: 400; }

.z-main { min-width: 0; }
.z-searchbar { background: #fff; border-radius: var(--z-radius); padding: 10px 12px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.z-search { flex: 1 1 360px; display: flex; align-items: center; gap: 8px; border: 1px solid var(--z-line); border-radius: 8px; padding: 0 10px; }
.z-search:focus-within { border-color: var(--z-accent); box-shadow: 0 0 0 3px var(--z-accent-soft); }
.z-search svg { flex-shrink: 0; color: var(--z-faint); }
.z-search input { flex: 1; border: 0; outline: 0; padding: 9px 0; font: inherit; font-size: 15px; background: transparent; min-width: 0; }
.z-found { color: var(--z-muted); white-space: nowrap; }
.z-found b { color: var(--z-ink); }

/* --- Строка закупки --- */
.z-list { background: #fff; border-radius: var(--z-radius); overflow: hidden; }
.z-row { display: block; padding: 10px 16px 11px; border-bottom: 1px solid var(--z-line); cursor: pointer; outline: none; transition: background .12s; }
.z-row:last-child { border-bottom: 0; }
.z-row:hover { background: var(--z-hover); }
.z-row.active, .z-row:focus-visible { background: var(--z-active); box-shadow: inset 3px 0 0 var(--z-accent); }
.z-r1 { display: flex; align-items: baseline; gap: 14px; }
.z-end { width: 70px; flex-shrink: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.z-typeprice { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; width: 360px; flex-shrink: 1; min-width: 0; }
.z-method { color: var(--z-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.z-price { font-weight: 700; font-size: 16px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.z-left { flex: 1; font-size: 13px; color: var(--z-green); white-space: nowrap; }
.z-left.soon { color: var(--z-red); font-weight: 600; }
.z-left.closed { color: var(--z-faint); }
.z-law { font-size: 12px; color: var(--z-muted); white-space: nowrap; }
.z-pub { width: 62px; text-align: right; color: var(--z-faint); font-size: 13px; font-variant-numeric: tabular-nums; }
.z-rbody { padding-left: 84px; }
.z-r2 { display: flex; align-items: baseline; gap: 12px; margin-top: 3px; font-size: 13px; }
.z-customer { color: var(--z-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.z-region { color: var(--z-faint); white-space: nowrap; flex-shrink: 0; }
.z-title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 3px; color: var(--z-ink); font-size: 15px; font-weight: 500; }
.z-row:hover .z-title { color: var(--z-accent); text-decoration: none; }
.z-r4 { display: flex; align-items: baseline; gap: 14px; margin-top: 4px; font-size: 12px; color: var(--z-faint); flex-wrap: wrap; }
.z-tag { font-size: 11px; border-radius: 5px; padding: 1px 6px; background: var(--z-bg); color: var(--z-muted); }
.z-tag.red { background: var(--z-red-soft); color: var(--z-red); }
.z-empty { padding: 48px 20px; text-align: center; color: var(--z-muted); }
.z-pages { display: flex; justify-content: center; align-items: center; gap: 10px; margin-top: 14px; color: var(--z-muted); }
.z-pages a { background: #fff; border-radius: 7px; padding: 6px 12px; }
.z-note { margin: 12px 16px 0; font-size: 12px; color: var(--z-faint); }

/* --- Выезжающая панель --- */
.z-overlay { position: fixed; inset: 0; z-index: 40; background: rgba(15, 23, 42, .28); opacity: 0; visibility: hidden;
             transition: opacity .28s ease, visibility 0s linear .28s; }
.z-overlay.open { opacity: 1; visibility: visible; transition: opacity .28s ease, visibility 0s; }
.z-panel { position: fixed; top: 0; right: 0; bottom: 0; z-index: 50; width: min(1120px, 94vw); background: var(--z-bg); box-shadow: var(--z-shadow);
           transform: translateX(104%); visibility: hidden; display: flex; flex-direction: column;
           transition: transform .34s cubic-bezier(.22, .8, .22, 1), width .3s ease, visibility 0s linear .34s; }
.z-panel.open { transform: none; visibility: visible; transition: transform .34s cubic-bezier(.22, .8, .22, 1), width .3s ease, visibility 0s; }
.z-panel.wide { width: 100vw; }
.z-panel-body { flex: 1; min-height: 0; display: flex; }
.z-panel-loading, .z-panel-error { flex: 1; display: grid; place-items: center; color: var(--z-muted); }
.z-spinner { width: 28px; height: 28px; border: 3px solid var(--z-line); border-top-color: var(--z-accent); border-radius: 50%; animation: z-spin .8s linear infinite; }
@keyframes z-spin { to { transform: rotate(360deg); } }
body.z-panel-open { overflow: hidden; }
@media (prefers-reduced-motion: reduce) { .z-panel, .z-overlay, .z-panel.open, .z-overlay.open { transition: none; } }

/* --- Карточка закупки --- */
.zc { flex: 1; display: flex; min-width: 0; min-height: 0; }
.zc-main { flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 0; }
.zc-rail { order: 2; width: 52px; flex-shrink: 0; background: #fff; border-left: 1px solid var(--z-line); display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 0; }
.zc-rail-btn { width: 36px; height: 36px; border: 0; border-radius: 50%; background: transparent; color: var(--z-muted); display: grid; place-items: center; cursor: pointer; }
.zc-rail-btn:hover { background: var(--z-bg); color: var(--z-ink); text-decoration: none; }
.zc-rail-btn.close { margin-bottom: 8px; color: var(--z-ink); }
.zc-rail-sep { width: 24px; border-top: 1px solid var(--z-line); margin: 4px 0; }
.zc-head { display: flex; align-items: center; gap: 12px; padding: 12px 20px; background: #fff; border-bottom: 1px solid var(--z-line); }
.zc-state { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 15px; }
.zc-state i { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; font-style: normal; }
.zc-state.open i { background: var(--z-green-soft); color: var(--z-green); }
.zc-state.review i { background: var(--z-amber-soft); color: var(--z-amber); }
.zc-state.closed i { background: var(--z-bg); color: var(--z-muted); }
.zc-state.cancelled i { background: var(--z-red-soft); color: var(--z-red); }
.zc-state small { font-weight: 400; color: var(--z-muted); font-size: 13px; }
.zc-state.open small.soon { color: var(--z-red); font-weight: 600; }
.zc-head-actions { margin-left: auto; display: flex; gap: 8px; }
.zc-tabs { display: flex; align-items: flex-end; gap: 2px; padding: 0 20px; background: #fff; border-bottom: 1px solid var(--z-line); }
.zc-tab { border: 0; background: none; cursor: pointer; padding: 11px 10px 9px; color: var(--z-muted); border-bottom: 2px solid transparent; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.zc-tab:hover { color: var(--z-ink); }
.zc-tab.on { color: var(--z-ink); border-bottom-color: var(--z-accent); font-weight: 600; }
.zc-tab-main { max-width: 46%; overflow: hidden; text-overflow: ellipsis; }
.zc-number { align-self: center; margin-left: 6px; color: var(--z-muted); font-size: 13px; white-space: nowrap; }
.zc-icon-btn { align-self: center; border: 0; background: none; color: var(--z-faint); cursor: pointer; padding: 4px; border-radius: 5px; display: inline-grid; place-items: center; }
.zc-icon-btn:hover { color: var(--z-ink); background: var(--z-bg); }
.zc-tabs-space { flex: 1; }
.zc-count { font-size: 11px; background: var(--z-bg); color: var(--z-muted); border-radius: 8px; padding: 0 6px; font-weight: 500; }
.zc-panes { flex: 1; min-height: 0; overflow-y: auto; }
.zc-pane { display: none; }
.zc-pane.on { display: block; }
.zc-cols { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 12px; padding: 12px; align-items: start; }
.zc-block { background: #fff; border-radius: var(--z-radius); padding: 16px 18px; }
.zc-block + .zc-block { margin-top: 12px; }
.zc-block h3 { margin: 0 0 10px; font-size: 15px; font-weight: 600; display: flex; align-items: baseline; gap: 10px; }
.zc-block h3 button { border: 0; background: none; color: var(--z-accent); cursor: pointer; font-size: 13px; font-weight: 400; padding: 0; }
.zc-meta { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--z-muted); }
.zc-meta a { color: var(--z-muted); }
.zc-customer { display: inline-block; margin-top: 10px; font-size: 15px; font-weight: 600; color: var(--z-ink); }
.zc-customer:hover { color: var(--z-accent); }
.zc-inn { font-size: 12px; color: var(--z-faint); margin-top: 2px; }
.zc-title { margin-top: 10px; font-size: 18px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.zc-title.expanded { -webkit-line-clamp: unset; display: block; }
.zc-more { border: 0; background: none; color: var(--z-accent); cursor: pointer; padding: 2px 0; font-size: 13px; }
.zc-industry { margin-top: 6px; font-size: 13px; color: var(--z-muted); }
.zc-field { display: grid; grid-template-columns: 150px 1fr; gap: 12px; margin-top: 14px; font-size: 14px; }
.zc-label { color: var(--z-faint); }
.zc-price { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--z-line); text-align: right; }
.zc-price-line { display: flex; justify-content: flex-end; align-items: baseline; gap: 8px; }
.zc-big { font-size: 30px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.1; }
.zc-big small { font-size: 16px; font-weight: 500; color: var(--z-muted); }
.zc-price-sub { margin-top: 4px; color: var(--z-muted); font-size: 13px; }
.zc-price-sub b { color: var(--z-ink); font-weight: 600; }
.zc-items { width: 100%; border-collapse: collapse; margin-top: 16px; font-size: 13px; }
.zc-items th { text-align: right; font-weight: 400; font-size: 11px; text-transform: uppercase; letter-spacing: .03em; color: var(--z-faint); padding: 6px 8px; border-bottom: 1px solid var(--z-line); }
.zc-items th:first-child, .zc-items td:first-child { text-align: left; padding-left: 0; }
.zc-items td { padding: 8px; border-bottom: 1px solid var(--z-line); text-align: right; white-space: nowrap; vertical-align: top; font-variant-numeric: tabular-nums; }
.zc-items td:first-child { white-space: normal; }
.zc-items td small { display: block; color: var(--z-faint); font-size: 11px; }
.zc-table-wrap { overflow-x: auto; }
.zc-stage { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 5px 0; }
.zc-stage span { color: var(--z-muted); }
.zc-stage b { font-weight: 500; font-variant-numeric: tabular-nums; }
.zc-stage.key b { font-weight: 700; }
.zc-stage b small { font-size: 12px; color: var(--z-muted); margin-left: 4px; font-weight: 400; }
.zc-contact { display: grid; gap: 3px; font-size: 14px; }
.zc-doc { display: flex; align-items: center; gap: 10px; padding: 6px 4px; border-radius: 7px; color: var(--z-ink); min-width: 0; }
.zc-doc:hover { background: var(--z-hover); text-decoration: none; }
.zc-doc-name { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-width: 0; line-height: 1.3; }
.zc-doc-name small { color: var(--z-faint); }
.zc-doc-desc { display: block; font-size: 12px; color: var(--z-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.zc-file { width: 26px; height: 30px; flex-shrink: 0; border-radius: 4px; display: grid; place-items: center; font-size: 8px; font-weight: 700; color: #fff; text-transform: uppercase; letter-spacing: .02em; background: #9aa4b2; }
.zc-file.word { background: #3f6fb5; } .zc-file.excel { background: #1f8a4c; } .zc-file.pdf { background: #d24a3a; }
.zc-file.archive { background: #8b6bb8; } .zc-file.image { background: #d08b22; }
.zc-docs-full { padding: 12px; }
.zc-feed { padding: 12px; }
.zc-event { display: grid; grid-template-columns: 130px 1fr; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--z-line); }
.zc-event:last-child { border-bottom: 0; }
.zc-event time { color: var(--z-muted); font-variant-numeric: tabular-nums; }
.z-toast { position: fixed; left: 50%; bottom: 28px; z-index: 80; transform: translate(-50%, 20px); background: #1f2937; color: #fff; padding: 8px 16px; border-radius: 8px;
           opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; font-size: 13px; }
.z-toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Карточка на отдельной странице (прямая ссылка, печать). */
.zc-standalone { background: var(--z-bg); border-radius: var(--z-radius); overflow: hidden; min-height: calc(100vh - 110px); display: flex; }
.zc-standalone .zc-panes { overflow: visible; }

/* --- Вход --- */
.z-login { max-width: 380px; margin: 60px auto; background: #fff; border-radius: 14px; padding: 28px; }
.z-login h1 { margin: 0 0 4px; font-size: 22px; }
.z-login .z-field { margin-top: 14px; }
.z-login .z-btn { width: 100%; margin-top: 18px; padding: 10px; }
.z-error { background: var(--z-red-soft); color: var(--z-red); border-radius: 8px; padding: 8px 12px; margin-top: 12px; font-size: 13px; }

@media (max-width: 1100px) {
  .zc-cols { grid-template-columns: 1fr; }
  .z-typeprice { width: auto; flex: 1; }
  .z-left { display: none; }
}
@media (max-width: 860px) {
  .z-layout { grid-template-columns: 1fr; }
  .z-side { position: static; max-height: none; }
  .z-panel { width: 100vw; }
  .z-rbody { padding-left: 0; }
  .z-pub, .z-law { display: none; }
  .zc-field { grid-template-columns: 1fr; gap: 2px; }
  .zc-rail { width: 44px; }
}
@media print {
  .z-top, .zc-rail, .zc-tabs, .zc-head-actions { display: none !important; }
  body { background: #fff; }
  .zc-cols { grid-template-columns: 1fr 280px; }
  .zc-pane { display: block !important; }
}
