/* Shared table structure, row states, utilities, and table toolbars. */

.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.table-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

th {
  text-align: left;
  padding: 10px 14px;
  font-size: var(--font-size-compact);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--grey);
  background: var(--grey-light);
  border-bottom: 2px solid var(--border);
}

td {
  padding: 9px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

tr:last-child td { border-bottom: none; }
tr.highlight-row td { background: rgba(200,169,110,0.08); font-weight: 600; }
tr.danger-row td { background: var(--red-light); color: var(--red); }
tr.good-row td { background: var(--green-light); }

td.num { text-align: right; font-family: 'DM Sans', sans-serif; }
td.positive { color: var(--green); font-weight: 500; }
td.negative { color: var(--red); font-weight: 500; }
td.zero { color: var(--grey); }

.pots-cell { font-size: var(--font-size-supporting); line-height: var(--line-height-supporting); }
.pots-cell .pot-line { display: flex; justify-content: space-between; gap: 10px; }
.pots-cell .pot-line span:first-child { color: var(--grey); }
.pots-cell .pot-line span:last-child {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.phase-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: var(--font-size-compact);
  font-weight: 600;
  letter-spacing: 0.5px;
  text-align: center;
}

.phase-1 { background: rgba(30,77,140,0.1); color: var(--blue); }
.phase-2 { background: rgba(45,122,79,0.1); color: var(--green); }

@media (max-width: 767px) {
  .table-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .table-toolbar-actions { width: 100%; }
  .table-toolbar .toggle-btn { flex: 1; }
}
