/* ── Базовое ── */
[x-cloak] { display: none !important; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

/* ── HTMX ── */
.htmx-indicator { opacity: 0; transition: opacity 200ms ease-in; }
.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator { opacity: 1; }

/* ── Таблица → карточки на мобильном (класс .mobile-cards) ── */
@media (max-width: 639px) {
  table.mobile-cards thead { display: none; }
  table.mobile-cards tbody tr {
    display: block;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e2e8f0;
  }
  table.mobile-cards tbody tr:last-child { border-bottom: none; }
  table.mobile-cards td {
    display: block;
    padding: 0.15rem 0;
    text-align: left !important;
  }
  table.mobile-cards td::before {
    content: attr(data-label);
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94a3b8;
    display: block;
    margin-bottom: 0.1rem;
  }
  table.mobile-cards td[data-label=""]::before,
  table.mobile-cards td:not([data-label])::before { display: none; }

  /* mc-full: полная ширина (остаётся) */
  /* mc-hide: скрыть на мобиле */
  table.mobile-cards td.mc-hide { display: none; }

  /* mc-half: две колонки рядом */
  table.mobile-cards td.mc-half {
    display: inline-block;
    width: 49%;
    vertical-align: top;
  }

  /* Мин. touch-target */
  .touch-target,
  table.mobile-cards a,
  table.mobile-cards button {
    min-height: 36px;
    display: inline-flex;
    align-items: center;
  }
}

/* ── Горизонтальный скролл с подсказкой ── */
.table-scroll-wrapper { position: relative; }
.table-scroll-wrapper::after {
  content: '';
  position: absolute;
  top: 0; right: 0; bottom: 0; width: 20px;
  background: linear-gradient(to right, transparent, rgba(255,255,255,0.9));
  pointer-events: none;
  transition: opacity 0.3s;
}
.table-scroll-wrapper.scrolled-end::after { opacity: 0; }

/* ── Скроллбары ── */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.12); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.22); }

/* ── Утилиты ── */
.truncate-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
