.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { text-align: left; padding: 0.6rem 0.5rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { color: var(--ink-soft); font-weight: 600; font-size: 0.8rem; text-transform: uppercase; }
th[data-sort] { cursor: pointer; user-select: none; }
th[data-sort]:hover { color: #333; }
.sort-arrow { display: inline-block; width: 1em; font-size: 0.75em; opacity: 0.6; }
#repoSearch { max-width: 340px; }

.repo-name-link {
  color: inherit;
  font-weight: inherit;
  text-decoration: none;
}
.repo-name-link:hover, .repo-name-link:focus-visible { text-decoration: underline; }

/* Taula de repositoris a escriptori: mateix llenguatge visual que la
   versió de targetes de mòbil (radius, badges, jerarquia), però com a
   taula real amb capçalera fixa i files amb hover. */
@media (min-width: 641px) {
  .table-scroll {
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
  }
  #reposTable { font-size: 0.88rem; }
  #reposTable thead th {
    background: var(--surface-soft);
    border-bottom: 1px solid var(--border);
    padding: 0.65rem 0.75rem;
  }
  #reposTable tbody tr { transition: background-color 0.15s ease; }
  #reposTable tbody tr:hover { background: var(--surface-soft); }
  #reposTable tbody tr:last-child td { border-bottom: none; }
  #reposTable td { padding: 0.6rem 0.75rem; }
  #reposTable td[data-label="Nom"] { font-weight: 600; color: var(--ink); }
  #reposTable td[data-label="Owner"],
  #reposTable td[data-label="Repo"] {
    font-family: var(--mono);
    font-size: 0.8rem;
    color: var(--ink-soft);
  }
  #reposTable td[data-label="Descripció"] {
    color: var(--ink-soft);
    white-space: normal;
    line-height: 1.4;
  }
  #reposTable td.actions { white-space: nowrap; }
}

@media (max-width: 640px) {
  /* La taula de repositoris, amb 4 columnes de text + accions, no cap
     en una pantalla de mòbil sense fer scroll horitzontal. Es
     transforma en una llista de targetes: cada fila és una targeta i
     cada valor porta la seva etiqueta (data-label) al davant. */
  .table-scroll { overflow-x: visible; }
  #reposTable thead { display: none; }
  #reposTable, #reposTable tbody, #reposTable tr, #reposTable td { display: block; width: 100%; }
  #reposTable tr {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.6rem 0.75rem;
    margin-bottom: 0.6rem;
    background: var(--card);
  }
  #reposTable td {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.4rem 0;
    border-bottom: 1px solid var(--border);
    text-align: right;
  }
  #reposTable tr td:last-child { border-bottom: none; }
  #reposTable td[data-label]::before {
    content: attr(data-label);
    flex-shrink: 0;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--ink-soft);
    text-align: left;
  }
  #reposTable td.actions { justify-content: flex-end; padding-top: 0.5rem; }
  #reposTable td.actions .actions-inner { justify-content: flex-end; width: 100%; }
}

.actions-inner { display: flex; align-items: center; gap: 0.35rem; white-space: nowrap; }
