/* Custom overrides on top of Tailwind */
input:invalid {
  border-color: #fca5a5;
}
table { border-collapse: collapse; }

/* ---- Mobile card layout for tables ---- */
@media (max-width: 640px) {
  /* Hide table headers, show as stacked cards */
  .mobile-cards thead { display: none; }
  .mobile-cards tbody tr {
    display: block;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    margin-bottom: 0.75rem;
    padding: 0.75rem;
    background: #fff;
  }
  .mobile-cards tbody tr:last-child { margin-bottom: 0; }
  .mobile-cards tbody td {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 0.25rem 0;
    border: none !important;
    gap: 0.5rem;
  }
  .mobile-cards tbody td::before {
    content: attr(data-label);
    font-weight: 600;
    font-size: 0.75rem;
    color: #64748b;
    flex-shrink: 0;
    min-width: 5.5rem;
  }
  .mobile-cards tbody td:empty { display: none; }

  /* Review table: stack inputs */
  .mobile-review thead { display: none; }
  .mobile-review tbody tr {
    display: block;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    margin-bottom: 0.75rem;
    padding: 0.75rem;
    background: #fff;
  }
  .mobile-review tbody td {
    display: block;
    padding: 0.25rem 0;
    border: none !important;
  }

  /* Stack manual entry rows */
  .row.flex { flex-wrap: wrap; }
  .row.flex input { flex: 1 1 100% !important; margin-bottom: 0.25rem; }
  .row.flex button.remove-row { margin-left: auto; }
}

/* Ensure touch targets are adequate */
@media (max-width: 640px) {
  input, select, button, a.inline-block {
    min-height: 44px;
  }
  input[type="text"], input[type="tel"], input[type="password"],
  input[type="date"], input[type="datetime-local"], select {
    font-size: 16px; /* prevents iOS zoom on focus */
  }
}
