/*
 * Growth Partner — Bedrijven index (UX overhaul 4c)
 *
 * Spec: docs/ux-overhaul/mockup/Bedrijven.dc.html. The company view tab
 * strip (shared/_company_view_tabs, also on companies#followed and
 * industrial_sites#index) and the companies table: Score, Bedrijf with one
 * muted subtitle, Laatste signaal, Laatste contact, Status, actions.
 *
 * Classes only (CSP). Text colours via the tokens (AA 4.5:1, guarded by
 * test/assets/color_contrast_test.rb). Phone rules at the bottom: the table
 * stays a <table> (rows are Turbo Stream targets) and becomes stacked cards
 * by CSS alone.
 */

/* ── Header ── */
.companies-header { align-items: center; }
.companies-header-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-left: auto; }

/* ── View tabs ── */
.company-view-tabs { margin: 0.25rem 0 1rem; }

/* ── Table ── */
.companies-table td { vertical-align: middle; }
.company-score-cell { width: 3.25rem; }
.company-row-name { font-weight: 700; color: var(--gp-navy); text-decoration: none; }
.company-row-name:hover { text-decoration: underline; }
.company-row-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin-top: 2px;
  font-size: 0.8rem; color: var(--gp-body);
}
.company-row-meta .badge { margin: 0; }
.company-signal-type { display: block; font-weight: 600; color: var(--gp-ink); }
.company-cell-sub { display: block; font-size: 0.8rem; color: var(--gp-body); }
.company-contact-line { display: inline-flex; align-items: center; gap: 6px; font-size: 0.85rem; color: var(--gp-ink); }
.company-contact-avatar { width: 22px; height: 22px; font-size: 0.6rem; }
.company-row-actions { display: flex; align-items: center; gap: 6px; }
.company-row-actions form { margin: 0; }

/* ── Phone: rows as stacked cards ── */
@media (max-width: 640px) {
  .companies-header-actions { margin-left: 0; }
  .companies-table-wrap { overflow: visible; }
  .companies-table, .companies-table tbody { display: block; width: 100%; }

  /* The header row stays (sort links, select-all) as a wrapped bar. */
  .companies-table thead { display: block; }
  .companies-table thead tr { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; }
  .companies-table thead th { display: block; border: 0; padding: 0; min-height: 40px; line-height: 40px; }
  .companies-table thead th:empty, .companies-table thead th:last-child { display: none; }

  .companies-table tbody tr.company-row {
    display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px;
    margin: 0 0 10px; padding: 12px 14px;
    background: #fff; border: 1px solid var(--gp-line); border-radius: 14px;
  }
  .companies-table tbody tr.company-row > td { display: block; border: 0; padding: 0; background: transparent; }
  .companies-table .bulk-td { width: auto; padding: 0 !important; }
  .companies-table .bulk-td input[type="checkbox"] { width: 1.5rem; height: 1.5rem; }
  .companies-table .company-name-cell { flex: 1 1 0; min-width: 0; }
  .companies-table .company-signal, .companies-table .company-contact { flex: 1 1 100%; }
  .companies-table .company-signal:empty { display: none; }
  .companies-table td[data-label]::before {
    content: attr(data-label); display: block; margin-bottom: 2px;
    font-size: 0.7rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
    color: var(--gp-body);
  }
  .companies-table .company-status-cell::before { display: none; }
  .companies-table .company-actions-cell { margin-left: auto; }

  /* Touch targets >= 40px. */
  .companies-table .company-status-cell select,
  .companies-table .company-row-actions button { min-height: 40px; }
  .company-row-name { display: inline-block; min-height: 40px; line-height: 40px; }
  .company-view-tabs > a { min-height: 40px; }
}
