/* «Стадо»: фильтры слева, таблица справа; на телефоне фильтры — панелью, строки — карточками. */
.herdhead { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.herdhead h1 { flex: 1; }
.hh-tools { display: flex; flex-wrap: wrap; gap: 8px; }
.hh-tools .btn svg { flex-shrink: 0; }
#h-filters { display: none; }
.herdwrap { display: grid; grid-template-columns: 248px minmax(0, 1fr); gap: 18px; align-items: start; }
.hfilters { position: sticky; top: calc(var(--top-h) + 16px); max-height: calc(100vh - var(--top-h) - 32px); overflow-y: auto; background: var(--paper); border-radius: 22px; padding: 16px; }
.hmain { display: flex; flex-direction: column; gap: 12px; min-width: 0; }

/* Фильтры */
.hf { display: flex; flex-direction: column; gap: 16px; }
.hf-q { display: flex; align-items: center; gap: 8px; height: 46px; padding: 0 12px; border: 1px solid var(--line); border-radius: 12px; color: var(--muted); }
.hf-q input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; color: var(--ink); font-size: 15px; }
.hf-block { display: flex; flex-direction: column; gap: 8px; }
.hf-l { font-size: 13px; font-weight: 600; color: var(--muted); }
.hf-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.hf-chips button { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: 999px; background: #fff; font-weight: 600; font-size: 14px; cursor: pointer; }
.hf-chips button i { font-style: normal; font-weight: 500; color: var(--muted); font-size: 12.5px; }
.hf-chips button[aria-pressed="true"] { background: var(--night); border-color: var(--night); color: #fff; }
.hf-chips button[aria-pressed="true"] i { color: #C9CEE3; }
.hf-seg { display: flex; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.hf-seg button { flex: 1; min-height: 38px; border: 0; border-left: 1px solid var(--line); background: #fff; font-weight: 600; cursor: pointer; }
.hf-seg button:first-child { border-left: 0; }
.hf-seg button[aria-pressed="true"] { background: var(--night); color: #fff; }
.hf select, .hf-range input { height: 42px; padding: 0 10px; border: 1px solid var(--line); border-radius: 12px; background: #fff; font-size: 15px; width: 100%; }
.hf-range { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.hf-check { min-height: 32px; font-size: 14px; }

/* Таблица */
.hsum { color: var(--ink-2); }
.hsum b { font: 700 18px var(--display); color: var(--ink); margin-right: 4px; }
.htable { overflow-x: auto; }
.htable table.grid { min-width: 100%; }
.htable table.grid td { white-space: nowrap; }
.htable td.hc-inv .nm { white-space: normal; }
.htable table.grid th { padding: 6px 8px; }
.htable table.grid td { padding: 9px 8px; }
.htable table.grid th.num, .htable table.grid td.num { text-align: right; }
.sorth { border: 0; background: none; padding: 6px 4px; font: inherit; color: inherit; cursor: pointer; white-space: nowrap; border-radius: 8px; }
.sorth:hover { background: var(--ground); color: var(--ink); }
.sorth.on { color: var(--ink); }
.sorth.on::after { content: ' ↑'; }
.sorth.on.desc::after { content: ' ↓'; }
.rp { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 13px; font-weight: 600; background: var(--line-2); white-space: nowrap; }
.rp-pregnant { background: var(--good-soft); color: var(--good-ink); }
.rp-fresh { background: var(--dawn-soft); color: var(--dawn-ink); }
.rp-bred { background: #E6ECFA; color: var(--night); }
.rp-dry { background: #EEE9F7; color: #4B3A78; }
.rp-open { background: var(--warn-soft); color: var(--warn-ink); }
.htable td.c-mob { display: none; }
.hmore { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 8px; }

@media (max-width: 1100px) {
  .herdwrap { grid-template-columns: minmax(0, 1fr); }
  .hfilters { display: none; }
  #h-filters { display: inline-flex; }
}
@media (max-width: 700px) {
  .hh-tools { width: 100%; }
  .hh-tools .btn { flex: 1; justify-content: center; }
  #h-xls { display: none; }
  .htable { background: none; overflow: visible; }
  .htable table.grid, .htable table.grid tbody { display: block; }
  .htable table.grid thead { display: none; }
  .htable table.grid tbody { display: flex; flex-direction: column; gap: 8px; }
  .htable table.grid tr { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; grid-template-areas: "chk inv rp" "chk meta meta"; gap: 4px 10px; align-items: center; background: #fff; border-radius: 16px; padding: 11px 14px 11px 10px; }
  .htable table.grid td { display: none; border: 0; padding: 0 !important; }
  .htable table.grid td.c-chk { display: block; grid-area: chk; }
  .htable table.grid td.hc-inv { display: flex; align-items: center; gap: 8px; grid-area: inv; }
  .htable table.grid td.hc-inv .nm { margin: 0; }
  .htable table.grid td.hc-repro { display: block; grid-area: rp; }
  .htable table.grid td.c-meta { display: block; grid-area: meta; font-size: 13.5px; color: var(--ink-2); white-space: normal; }
  .hv-cols { display: none; }
}

/* Окно колонок */
.colpick { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: 28px; align-items: start; }
.colorder { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; counter-reset: c; }
.colorder li { display: flex; align-items: center; gap: 4px; min-height: 40px; padding: 0 6px 0 10px; border-radius: 12px; background: var(--ground); counter-increment: c; }
.colorder li::before { content: counter(c); width: 20px; color: var(--muted); font-size: 13px; font-weight: 600; }
.colorder li span { flex: 1; min-width: 0; font-weight: 600; font-size: 14.5px; }
.colorder button { width: 32px; height: 32px; border: 0; border-radius: 8px; background: transparent; color: var(--ink-2); font-size: 16px; cursor: pointer; }
.colorder button:hover:not(:disabled) { background: #fff; color: var(--ink); }
.colorder button:disabled { opacity: .25; cursor: default; }
.colgroup { margin-top: 12px; }
.colgroup .checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 2px 12px; margin-top: 4px; }
@media (max-width: 800px) { .colpick { grid-template-columns: minmax(0, 1fr); } }

/* Мои отборы */
.hviews { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.hv-l { font-size: 13px; font-weight: 600; color: var(--muted); margin-right: 2px; }
.hv { display: inline-flex; align-items: center; border-radius: 10px; background: var(--paper); border: 1px solid var(--line); }
.hv-open { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 12px; border: 0; background: none; font: 600 14px var(--font, inherit); color: var(--ink); cursor: pointer; border-radius: 10px; }
.hv-open svg { color: var(--muted); }
.hv.on { background: #E6ECFA; border-color: var(--night); }
.hv.on .hv-open { color: var(--night); }
.hv-more { width: 30px; min-height: 34px; border: 0; border-left: 1px solid #C9D3EE; background: none; font-size: 17px; line-height: 1; color: var(--night); cursor: pointer; border-radius: 0 10px 10px 0; }
.hv-act { min-height: 34px; padding: 0 12px; border: 1px dashed #B9C0D6; border-radius: 10px; background: none; font-weight: 600; font-size: 14px; color: var(--night); cursor: pointer; }
.hv-act:hover, .hv-open:hover { background: var(--ground); }
.hv-form { display: flex; flex-direction: column; gap: 16px; }
.hv-form .field input { height: 50px; padding: 0 14px; border: 1px solid #C9CEE0; border-radius: 14px; font-size: 17px; }
.linkbtn.danger { color: var(--bad); }
