/* HIVE UX audit 2026-06-14 — small, targeted remediations (non-brand).
   Loaded after the feature CSS so these win by source order. */

/* ── #6 Touch targets ≥ 24×24 on compact row / clear controls ─────────────────
   Pads the *clickable* area without enlarging the glyph; rows are ~50px tall so
   this does not grow them. Keeps the dense look (HIVE-222) intact. */
.row-action-icon,
.data-table td.row-actions > button,
.data-table td.row-actions > a,
.ac-clear,
.vehicle-autocomplete .ac-clear {
  min-width: 24px;
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}
/* The ellipsis <i> is often wrapped in a zero-padding <button>; giving the icon a
   24px box makes the whole control a 24px target. */
.row-action-icon { padding: 5px; line-height: 1; cursor: pointer; }

/* ── #3 Tier-2 mobile: generic card title for admin/report tables ─────────────
   mobile-card-tables.js tags the first data cell data-cardcell="title". The Claims
   title rule hard-indents 30px to clear its top-left checkbox; generic tables have
   no pinned checkbox unless a header-less select column exists, so indent only then. */
@media (max-width: 768px) {
  table.list-cards-mobile[data-mct] tbody td[data-cardcell="title"] {
    padding-left: 0;
    font-weight: 600;
    font-size: 14px;
  }
  table.list-cards-mobile[data-mct] tbody tr:has(td[data-cardcell="check"]) td[data-cardcell="title"] {
    padding-left: 30px;
  }
  /* Decorative leading cells (drag-handle grip / spacer) — hidden on the card. */
  table.list-cards-mobile[data-mct] tbody td[data-cardcell="decor"] {
    display: none;
  }
}

/* ── #3 Tier-1 mobile: non-card tables stay reachable via horizontal scroll ────
   Admin/report tables don't opt into the card reflow (table.list-cards-mobile),
   so at phone widths they clipped columns — incl. the actions / email-toggle
   column — off-screen with no way to reach them. Make their wrapper scroll.
   The Claims-style list pages (card reflow) are excluded via :has(). */
@media (max-width: 768px) {
  .data-table-wrapper:not(:has(table.list-cards-mobile)) {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* ── Mobile/tablet: attachment-type cards single-column ───────────────────────
   The document upload grid (`.claims-wizard-upload-grid`) defaults to 2 columns
   and only had a 1-col override in claim-details-v2.css (not loaded on every view
   that renders _Section_Documents), so on narrow widths the ~17 attachment cards
   crammed into 2 ragged, uneven-height columns. Globally force a single column up
   to tablet width so each card is full-width and clean. Desktop (>1024px) keeps
   its multi-column layout. */
@media (max-width: 1024px) {
  .claims-wizard-upload-grid {
    grid-template-columns: 1fr !important;
  }
  /* claim-attachments.js puts an inline `grid-column: span 2` on the last
     "other-documents" card; with a single explicit column that span forces an
     implicit 2nd column (the ragged 2-col layout). Neutralise it on mobile so
     every card spans the one column. (!important beats the inline style.) */
  .claims-wizard-upload-grid > * {
    grid-column: auto !important;
  }
}

/* ── #7 Dark-mode: keep CmrInternal/ClaimsReview urgency tints readable ───────
   The row tints (#F4CCCC/#FCE5CD/#FFF2CC) stay light under the dark theme, so the
   inherited light text became invisible. Force dark text on those tinted cells. */
html[data-theme="dark"] .claims-review-matrix tr.row-red td,
html[data-theme="dark"] .claims-review-matrix tr.row-orange td,
html[data-theme="dark"] .claims-review-matrix tr.row-yellow td {
  color: #1a1a1a;
}
