/* Список объектов («Объекты», /dela) и «Недавние объекты» на первом экране.
   Вынесено из rezultat.css в волне 3 дизайна экранов (потолок 800 строк). */

/* --- «Мои дела» --------------------------------------------------------- */

/* Список таблицей (F1): объект — строка, числа столбцами. Ссылка названия
   растянута на всю строку (::after), поэтому строка открывает объект целиком;
   «назвать», архив и корзина подняты над ней и нажимаются сами по себе. */
.dela-tablica {
  background: var(--paper);
  border: 1px solid var(--bd);
  border-radius: var(--r-md);
  box-shadow: var(--sh-1);
  overflow: hidden;
}
.dela-stroka {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 104px 80px 112px 150px 36px;
  gap: 16px;
  align-items: center;
  padding: 12px 14px 12px 18px;
  border-top: 1px solid var(--bd);
  font-size: 14.5px;
}
.dela-stroka:first-child { border-top: 0; }
.dela-card:hover { background: var(--hover); }
.dela-card:focus-within { background: var(--hover); }
.dela-shapka { padding-top: 9px; padding-bottom: 9px; background: var(--sunken); color: var(--fg-3); font-size: 12.5px; }
.dela-chislo { text-align: right; font-variant-numeric: tabular-nums; }
.dela-data { font-variant-numeric: tabular-nums; color: var(--fg-2); }
.dela-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 10px;
  min-width: 0;
}
.dela-title {
  font-size: 15.5px;
  font-weight: 600;
  letter-spacing: -.01em;
  color: var(--ink, var(--fg-1));
  text-decoration: none;
  overflow-wrap: anywhere;
}
.dela-otkryt::after { content: ""; position: absolute; inset: 0; }
.dela-otkryt:focus-visible { outline: none; }
.dela-otkryt:focus-visible::after { outline: 2px solid var(--accent-ring, var(--accent)); outline-offset: -2px; border-radius: var(--r-md); }
.dela-region { flex-basis: 100%; color: var(--fg-3); font-size: 12.5px; }
.dela-nazvat, .dela-udalitsya a, .dela-udalit { position: relative; z-index: 1; }
.dela-podpis { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.dela-metka {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 12.5px;
  line-height: 18px;
  font-weight: 500;
  white-space: nowrap;
}
.dela-metka-vopros { color: var(--accent-ink); background: var(--accent-wash); }
.dela-metka-gotovo { color: oklch(0.45 0.10 155); background: oklch(0.55 0.10 155 / 0.12); }
.dela-tolko-telefon { display: none; }
.dela-udalit {
  display: inline-flex;
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-xs);
  color: var(--fg-3);
}
.dela-udalit:hover, .dela-udalit:focus-visible { color: var(--stop); background: oklch(0.51 0.19 25 / 0.08); }

/* Телефон (F2): та же строка — короткая карточка. Название и метка сверху,
   ниже одной строкой «цены на · позиций · строк с ценой», корзина в углу. */
@media (max-width: 760px) {
  .dela-tablica { display: grid; gap: 10px; background: none; border: 0; box-shadow: none; overflow: visible; }
  .dela-stroka.dela-shapka { display: none; }
  .dela-stroka {
    display: block;
    padding: 14px 48px 14px 16px;
    border: 1px solid var(--bd);
    border-radius: var(--r-md);
    background: var(--paper);
    box-shadow: var(--sh-1);
    font-size: 13px;
    line-height: 1.5;
    color: var(--fg-3);
  }
  .dela-stroka:first-child { border-top: 1px solid var(--bd); }
  .dela-head { gap: 4px 10px; margin-bottom: 4px; }
  .dela-head .dela-title { flex: 1 1 auto; min-width: 0; }
  .dela-tolko-telefon { display: inline-flex; }
  .dela-sostoyanie { display: none; }
  .dela-podpis { position: static; width: auto; height: auto; overflow: visible; clip: auto; }
  .dela-data, .dela-chislo { display: inline; color: var(--fg-3); text-align: left; }
  .dela-chislo::before { content: " · "; }
  /* Цели под палец не меньше 44 px: корзина, «назвать» и ссылка архива
     расширены полями, текст стоит на месте. */
  .dela-udalit { position: absolute; right: 2px; bottom: 2px; width: 44px; height: 44px; }
  .dela-nazvat > summary { display: inline-block; padding: 14px 8px; margin: -14px -8px; }
  .dela-udalitsya a { display: inline-block; padding: 12px 0; margin: -12px 0; }
}

/* Имя из бумаг (F3) читается подписью, а не названием: тоньше своего имени.
   «назвать» — тихая ссылка рядом; поле открывается под строкой имени. */
.dela-title[data-iz-bumag] { font-weight: 500; color: var(--fg-2); }
.dela-nazvat > summary {
  display: inline;
  list-style: none;
  cursor: pointer;
  color: var(--accent-ink);
  font-size: 12.5px;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.dela-nazvat > summary::-webkit-details-marker { display: none; }
.dela-nazvat[open] { flex-basis: 100%; order: 3; }
.dela-nazvat form { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 8px; }
.dela-nazvat input[type="text"] {
  flex: 1 1 260px;
  max-width: 480px;
  padding: 8px 10px;
  border: 1px solid var(--bd);
  border-radius: var(--r-sm);
  background: var(--paper);
  color: var(--fg-1);
  font: inherit;
  font-size: 14px;
}
.dela-povtor { flex-basis: 100%; margin: 2px 0 0; color: var(--fg-3); font-size: 13px; }

/* Близкая уборка (F4): строка появляется только за неделю до неё. Сегодня и
   завтра — плашкой цвета остановки. */
.dela-udalitsya { flex-basis: 100%; margin: 4px 0 0; color: var(--fg-2); font-size: 13px; }
.dela-udalitsya a { color: var(--accent-ink); }
.dela-udalitsya.srochno {
  flex-basis: auto;
  padding: 4px 10px;
  border-radius: var(--r-xs);
  background: oklch(0.51 0.19 25 / 0.08);
  color: var(--stop);
}

/* Пятёрка недавних дел на первом экране — карточка целиком кликабельна. */
.recent-cases { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.recent-case {
  display: block;
  text-align: left;
  color: inherit;
  text-decoration: none;
}
.recent-case:hover { background: var(--hover); }
.recent-cases { align-items: start; }
.recent-verh { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: flex-start; justify-content: space-between; }
.recent-verh .dela-metka { flex: none; }
.recent-name { display: -webkit-box; flex: 1 1 12ch; min-width: 0; font-weight: 600; overflow-wrap: break-word;
  -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
.recent-meta { display: block; color: var(--fg-3); font-size: 12.5px; margin-top: var(--s-1); }
.recent-title { margin-top: var(--s-5); }
