.table-section {
  margin-top: 2.5rem;
}

.table-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
}

.btn-download {
  font-family: var(--font);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  background: none;
  border: 1px solid var(--border-strong);
  border-radius: 0;
  padding: 0.3rem 0.7rem;
  cursor: pointer;
  transition: color 0.12s, border-color 0.12s;
}

.btn-download:hover {
  color: var(--text);
  border-color: var(--text);
}

.btn-download:disabled {
  opacity: 0.3;
  cursor: default;
}

.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-top: 1px solid var(--text);
  border-bottom: 1px solid var(--border);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font);
  font-size: 0.82rem;
}

thead th {
  background: var(--bg);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-secondary);
  padding: 0.65rem 0.85rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  user-select: none;
}

thead th.sortable { cursor: pointer; }
thead th.sortable:hover { color: var(--text); }

thead th .sort-icon {
  display: inline-block;
  margin-left: 0.3rem;
  opacity: 0.35;
  font-size: 0.65rem;
}

thead th.sort-asc .sort-icon,
thead th.sort-desc .sort-icon { opacity: 1; }

thead th.align-right { text-align: right; }

tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.08s;
}

tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--bg-subtle); }

tbody td {
  padding: 0.55rem 0.85rem;
  white-space: nowrap;
  color: var(--text);
  font-size: 0.82rem;
}

tbody td.align-right {
  text-align: right;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
}

tbody td.null-val { color: var(--text-tertiary); }

tbody tr.highlight-cz td:first-child { color: var(--color-cz); font-weight: 600; }
tbody tr.highlight-ea td:first-child { color: var(--color-ea); font-weight: 600; }
tbody tr.highlight-eu td:first-child { color: var(--color-eu); font-weight: 600; }

.table-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.75rem;
  font-size: 0.75rem;
  color: var(--text-tertiary);
}

.pagination-controls { display: flex; gap: 0.4rem; }

.btn-page {
  font-family: var(--font);
  font-size: 0.75rem;
  color: var(--text-tertiary);
  background: none;
  border: 1px solid var(--border-strong);
  border-radius: 0;
  padding: 0.25rem 0.65rem;
  cursor: pointer;
  transition: color 0.12s, border-color 0.12s;
}

.btn-page:hover:not(:disabled) {
  color: var(--text);
  border-color: var(--text);
}

.btn-page:disabled { opacity: 0.3; cursor: default; }

/* Touch devices: bigger tap targets, no sticky hover highlight */
@media (hover: none) and (pointer: coarse) {
  thead th { padding: 0.85rem 0.85rem; }
  .btn-page { padding: 0.7rem 1rem; min-height: 44px; }
  .btn-download { padding: 0.55rem 0.9rem; min-height: 40px; }
  tbody tr:hover { background: none; }
}

@media (max-width: 640px) {
  tbody td { padding: 0.5rem 0.6rem; }
  thead th { padding-left: 0.6rem; padding-right: 0.6rem; }
}
