/* Mobile compact rows for clients, vehicles, orders and invoices. */
@media (max-width: 700px) {
  table.mobile-accordion-table tbody {
    gap: 8px;
  }

  table.mobile-accordion-table tbody tr.mobile-accordion-row {
    position: relative;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }

  table.mobile-accordion-table tbody tr.mobile-accordion-row:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--primary-color) 35%, transparent);
    outline-offset: 2px;
  }

  table.mobile-accordion-table tbody tr.mobile-accordion-row:not(.mobile-expanded) td {
    display: none;
  }

  table.mobile-accordion-table tbody tr.mobile-accordion-row:not(.mobile-expanded) td:first-child {
    display: block;
    min-height: 58px;
    padding: 11px 42px 10px 12px;
    border-bottom: 0;
    overflow: hidden;
    text-align: left;
    background: var(--surface);
  }

  table.mobile-accordion-table tbody tr.mobile-accordion-row td:first-child {
    position: relative;
    padding-right: 42px;
  }

  table.mobile-accordion-table tbody tr.mobile-accordion-row td:first-child::before {
    content: "";
    position: absolute;
    top: 50%;
    right: 16px;
    width: 9px;
    height: 9px;
    margin-top: -7px;
    border-right: 2px solid var(--text-muted);
    border-bottom: 2px solid var(--text-muted);
    transform: rotate(45deg);
    transition: transform .18s ease, margin-top .18s ease;
  }

  table.mobile-accordion-table tbody tr.mobile-accordion-row.mobile-expanded td:first-child::before {
    margin-top: -2px;
    transform: rotate(225deg);
  }

  table.mobile-accordion-table tbody tr.mobile-accordion-row:not(.mobile-expanded) td:first-child strong,
  table.mobile-accordion-table tbody tr.mobile-accordion-row:not(.mobile-expanded) td:first-child small {
    display: inline;
    max-width: 100%;
    margin: 0;
    white-space: nowrap;
  }

  table.mobile-accordion-table tbody tr.mobile-accordion-row:not(.mobile-expanded) td:first-child small::before {
    content: " · ";
  }

  table.mobile-accordion-table tbody tr.mobile-accordion-row:not(.mobile-expanded) td:first-child::after {
    content: attr(data-mobile-summary);
    display: block;
    margin-top: 4px;
    overflow: hidden;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  table.mobile-accordion-table tbody tr.mobile-accordion-row:not(.mobile-expanded) td:first-child[data-mobile-summary=""]::after {
    display: none;
  }

  table.mobile-accordion-table tbody tr.mobile-accordion-row.mobile-expanded td:not(:first-child) {
    animation: mobile-row-reveal .16s ease-out;
  }

  table.mobile-accordion-table tbody tr.mobile-accordion-row .actions-cell {
    cursor: default;
  }
}

@keyframes mobile-row-reveal {
  from { opacity: 0; transform: translateY(-3px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  table.mobile-accordion-table tbody tr.mobile-accordion-row td:first-child::before {
    transition: none;
  }

  table.mobile-accordion-table tbody tr.mobile-accordion-row.mobile-expanded td:not(:first-child) {
    animation: none;
  }
}
