/* Блок «Авеста»: доповнення до base.css. Спершу телефон; від 900px — бокове меню й широкі таблиці. */
.boot { padding: 40px 16px; text-align: center; color: var(--muted-fg); }
.side__nav { overflow-y: auto; }
.side__sep { margin: 10px 12px 4px; font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted-fg); }
.top .btn.icon { flex: none; }
.top__title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.menu a { display: flex; align-items: center; gap: 10px; padding: 14px 12px; border: 1px solid var(--border); border-radius: 12px; text-decoration: none; font-weight: 500; }
.menu a .ic { color: var(--muted-fg); }
@media (min-width: 900px) { .only-m { display: none !important; } .main { padding-bottom: 60px; } }
@media (max-width: 899px) { .only-d { display: none !important; } }

/* заголовок сторінки й панель фільтрів */
.head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.head h2 { font-size: 18px; flex: 1; min-width: 0; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.filters .inp { width: auto; min-width: 0; }
.filters .search { flex: 1 1 200px; } .filters .search .inp { width: 100%; }
.filters input[type=date] { max-width: 150px; }
.totals { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--muted-fg); margin: 8px 2px; }
.totals b { color: var(--fg); }
.pos { color: var(--ok); } .neg { color: var(--danger); }
.linkish { color: var(--info); cursor: pointer; text-decoration: none; } .linkish:hover { text-decoration: underline; }
.pre { white-space: pre-wrap; }

/* таблиці, які на телефоні стають картками */
.tbl td.r, .tbl th.r { text-align: right; }
.tbl tr.dim td { color: var(--muted-fg); }
@media (min-width: 761px) { .tbl td.nw { white-space: nowrap; } }
.tbl tr.total td { font-weight: 600; background: var(--side); }
@media (max-width: 760px) {
  .tbl.resp thead { display: none; }
  .tbl.resp tr { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 10px 12px; border-bottom: 1px solid var(--border); }
  .tbl.resp tr:last-child { border-bottom: 0; }
  .tbl.resp td { border: 0; padding: 0; font-size: 12.5px; color: var(--muted-fg); grid-column: 1; min-width: 0; overflow-wrap: anywhere; }
  .tbl.resp td.m-title { grid-column: 1 / -1; font-size: 14px; font-weight: 600; color: var(--fg); }
  .tbl.resp td.m-right { grid-column: 2; grid-row: 2; text-align: right; font-size: 14px; font-weight: 600; color: var(--fg); white-space: nowrap; }
  .tbl.resp td.m-hide, .tbl.resp td:empty { display: none; }
  .tbl.resp td.m-l::before { content: attr(data-l) ': '; }
}

/* документ */
.doc { display: grid; gap: 14px; }
.doc__status { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.doc__grid { display: grid; gap: 12px; }
@media (min-width: 700px) { .doc__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .doc__grid .full { grid-column: 1 / -1; } }
@media (min-width: 1100px) { .doc__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.doc__bar { position: sticky; bottom: calc(var(--tabs) + var(--safe-b)); z-index: 15; display: flex; gap: 8px; flex-wrap: wrap; padding: 10px 14px; margin: 0 -14px; background: var(--bg); border-top: 1px solid var(--border); }
@media (min-width: 900px) { .doc__bar { bottom: 0; margin: 0; padding: 12px 0; } }
.doc__bar .sp { flex: 1; }
.lines { display: grid; gap: 0; border: 1px solid var(--border); border-radius: 12px; background: var(--card); }
.ln.hd { border-radius: 12px 12px 0 0; }
.ln { display: grid; grid-template-columns: var(--cols); gap: 8px; align-items: center; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.ln:last-child { border-bottom: 0; }
.ln.hd { background: var(--side); font-size: 12px; font-weight: 500; color: var(--muted-fg); padding: 8px 10px; }
.ln .inp { min-height: 34px; padding: 5px 8px; font-size: 14px; }
.ln .n { color: var(--muted-fg); font-size: 12px; text-align: center; }
.ln .r { text-align: right; } .ln input.r { text-align: right; }
.ln .hint { font-size: 11.5px; color: var(--muted-fg); }
.ln .hint.neg { color: var(--danger); }
@media (max-width: 760px) {
  .ln.hd { display: none; }
  .ln { grid-template-columns: repeat(3, minmax(0, 1fr)) 34px; row-gap: 6px; padding: 10px; }
  .ln .n { display: none; }
  .ln .c-item, .ln .c-ref, .ln .c-note, .ln .c-spec, .ln .c-partner { grid-column: 1 / -1; }
  .ln .c-item, .ln .c-ref { grid-column: 1 / 4; } .ln .c-del { grid-column: 4; grid-row: 1; }
  .ln [data-l]::before { content: attr(data-l); display: block; font-size: 11px; color: var(--muted-fg); margin-bottom: 2px; }
  .ln .r { text-align: left; } .ln input.r { text-align: left; }
}
.kvs { display: grid; gap: 10px 18px; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.kvs div { min-width: 0; } .kvs small { display: block; font-size: 11.5px; color: var(--muted-fg); } .kvs b { font-weight: 500; overflow-wrap: anywhere; }
.warnlist { margin: 8px 0 0; padding-left: 18px; display: grid; gap: 4px; font-size: 13.5px; }
.chain { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; font-size: 13px; }

/* підказки вибору */
.suggest__list button { display: flex; width: 100%; gap: 8px; align-items: baseline; justify-content: space-between; text-align: left; border: 0; background: none; padding: 8px 10px; cursor: pointer; font-size: 13.5px; }
.suggest__list button:hover, .suggest__list button.on { background: var(--muted); }
.suggest__list small { color: var(--muted-fg); white-space: nowrap; }
.suggest__list { z-index: 50; max-height: 280px; }

/* права за ролями */
.matrix th, .matrix td { text-align: center; } .matrix td:first-child, .matrix th:first-child { text-align: left; position: sticky; left: 0; background: var(--card); min-width: 190px; }
.matrix th { vertical-align: bottom; white-space: normal; min-width: 84px; font-size: 11.5px; }
.matrix input { width: 17px; height: 17px; accent-color: var(--primary); }
.steps2 { margin: 0; padding-left: 20px; display: grid; gap: 6px; font-size: 13.5px; }

/* друк */
.print { display: none; }
@media print {
  body.printing > *:not(.print) { display: none !important; }
  body.printing .print { display: block; font: 11pt/1.35 Arial, sans-serif; color: #000; }
  .print h1 { font-size: 15pt; margin: 0 0 10pt; border-bottom: 2px solid #000; padding-bottom: 4pt; }
  .print table { width: 100%; border-collapse: collapse; margin: 8pt 0; }
  .print th, .print td { border: 1px solid #000; padding: 3pt 5pt; font-size: 10pt; text-align: left; }
  .print td.r, .print th.r { text-align: right; white-space: nowrap; }
  .print .pkv { display: grid; grid-template-columns: 110pt 1fr; gap: 3pt 8pt; margin-bottom: 6pt; }
  .print .sign { display: grid; grid-template-columns: 1fr 1fr; gap: 30pt; margin-top: 28pt; }
  .print .sign div { border-top: 1px solid #000; padding-top: 3pt; font-size: 9pt; }
  .doc__bar, .tools, .filters { display: none !important; }
  @page { margin: 12mm; }
}
.head .inp { width: auto; }
