/* Рабочие списки. На телефоне таблица становится карточками. */
/* Рабочие списки */
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.chip { flex-shrink: 0; display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--ink); text-decoration: none; font-weight: 600; font-size: 15px; }
.chip i { font-style: normal; padding: 1px 8px; border-radius: 999px; background: var(--line-2); font-size: 13px; }
.chip.on { background: var(--night); border-color: var(--night); color: #fff; }
.chip.on i { background: var(--dawn); color: #fff; }
.tablebox { background: var(--paper); border-radius: 22px; overflow-x: auto; }
table.grid { width: 100%; min-width: 900px; border-collapse: collapse; font-size: 15px; }
table.grid th { text-align: left; color: var(--muted); font-size: 13px; font-weight: 600; padding: 14px 10px; white-space: nowrap; }
table.grid td { padding: 10px; border-top: 1px solid var(--line-2); vertical-align: middle; }
table.grid th:first-child, table.grid td:first-child { padding-left: 18px; width: 44px; }
table.grid .sub { display: block; font-size: 13px; color: var(--muted); }
table.grid .nm { display: block; font-size: 13px; color: var(--muted); margin-top: 3px; }
table.grid .c-inv a { text-decoration: none; }
table.grid tr.sel td { background: #F3F5FB; }
table.grid input[type=checkbox] { width: 22px; height: 22px; accent-color: var(--night); }
table.grid .c-meta { display: none; }
.selbar { position: sticky; bottom: 16px; background: var(--night); color: #fff; border-radius: 20px; padding: 12px 14px 12px 20px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; box-shadow: 0 14px 34px rgba(30,42,85,.3); }
.selbar[hidden] { display: none; }
.selbar b { font: 700 16px var(--display); flex-grow: 1; }
.selbar .btn:not(.dawn) { background: transparent; color: #fff; border-color: var(--night-3); }

/* Шапка списка: название слева, ферма, поиск и печать справа */
.listhead { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 16px; }
.lh-title { flex: 1 1 320px; display: flex; flex-direction: column; gap: 4px; }
.lh-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.sitepick select { height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; font-weight: 600; max-width: 240px; }
.findin { display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--muted); }
.findin input { border: 0; outline: none; background: transparent; width: 150px; color: var(--ink); }
.listhead .btn svg { flex-shrink: 0; }

/* Сделано N из M */
.progress { display: flex; flex-direction: column; gap: 8px; background: var(--good-soft); border-radius: 16px; padding: 12px 16px; }
.progress[hidden] { display: none; }
.progress div { display: flex; justify-content: space-between; gap: 10px; color: var(--good-ink); }
.progress i { display: block; height: 6px; border-radius: 99px; background: var(--good); transition: width .3s; }

/* Действие в строке */
table.grid .c-act { text-align: right; white-space: nowrap; padding-right: 16px; }
.rowseg { display: inline-flex; border: 1px solid #C9CEE0; border-radius: 12px; overflow: hidden; }
.rowseg button { min-height: 40px; min-width: 44px; padding: 0 12px; border: 0; border-left: 1px solid #C9CEE0; background: #fff; font-weight: 600; cursor: pointer; }
.rowseg button:first-child { border-left: 0; }
.rowseg button:hover { background: var(--night); color: #fff; }
.rowbtn { min-height: 40px; }
table.grid tr.is-done td { background: var(--good-soft); }
.done-mark { font-weight: 700; color: var(--good-ink); margin-right: 10px; }
.nofound { padding: 20px; text-align: center; }
.nofound[hidden] { display: none; }

@media (max-width: 700px) {
  .selbar { bottom: 84px; }
  /* Список — карточки: бирка и главная цифра крупно, остальное строкой */
  .tablebox { background: none; overflow: visible; }
  table.grid { min-width: 0; display: block; }
  table.grid thead { display: none; }
  table.grid tbody { display: flex; flex-direction: column; gap: 8px; }
  table.grid tr { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; grid-template-areas: "chk inv key" "chk meta meta" "act act act"; gap: 6px 10px; align-items: center; background: #fff; border-radius: 16px; padding: 11px 14px 11px 10px; }
  table.grid tr.is-done { background: var(--good-soft); }
  table.grid tr[hidden] { display: none; }
  table.grid .c-act { grid-area: act; text-align: left; padding-top: 4px !important; white-space: normal; }
  table.grid .c-act:empty { display: none; }
  .rowseg { display: flex; }
  .rowseg button { flex: 1; min-height: 46px; }
  .rowbtn { width: 100%; justify-content: center; min-height: 46px; }
  .listhead { align-items: stretch; }
  .lh-tools { width: 100%; }
  .findin { flex: 1; }
  .findin input { width: 100%; }
  .sitepick { flex: 1 1 100%; }
  .sitepick select { width: 100%; max-width: none; }
  #print { display: none; }
  table.grid td { border: 0; padding: 0 !important; width: auto !important; font-size: 14px; }
  table.grid .c-site, table.grid .c-lact, table.grid .c-ins, table.grid .c-milk { display: none; }
  table.grid .c-chk { grid-area: chk; }
  table.grid .c-inv { grid-area: inv; display: flex; align-items: center; gap: 8px; min-width: 0; }
  table.grid .c-inv .nm { margin: 0; }
  table.grid .c-key { grid-area: key; text-align: right; line-height: 1.1; }
  table.grid .c-key b { font: 700 20px var(--display); }
  table.grid .c-key .sub { font-size: 11px; }
  table.grid .c-meta { display: block; grid-area: meta; color: var(--ink-2); font-size: 13.5px; }
  table.grid .c-meta .sub { display: block; font-size: 13px; margin-top: 2px; }
}
