/*
 * Tables
 *
 * BEM-style component classes for table cells and headers,
 * written directly in ERB.
 *
 * Usage:
 *   class="td td--align-left"      (default cell)
 *   class="td td--align-right"     (right-aligned cell)
 *   class="th th--align-left"      (default header cell)
 *   class="th th--align-center"    (centered header cell)
 */

.table-stripped > tbody > tr:nth-child(odd) > td {
  background: var(--color-surface);
}

.table-stripped > tbody > tr:nth-child(even) > td {
  background: var(--color-surface-muted);
}

/* ------------------------------------------------------------------ */
/* Simple table — wrapper from Ui::Tables::SimpleComponent.           */
/* ------------------------------------------------------------------ */

.simple-table {
  min-width: 100%;
}

.simple-table--spaced {
  margin-block-start: 1.5rem;
}

/* ------------------------------------------------------------------ */
/* Stripped table — overflow wrapper used by                          */
/* Ui::Tables::StrippedComponent.                                     */
/* ------------------------------------------------------------------ */

.stripped-table {
  margin-top: -0.5rem;
  margin-bottom: -0.5rem;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
  overflow-x: auto;
}

.stripped-table__inner {
  display: inline-block;
  vertical-align: middle;
  min-width: 100%;
  overflow: hidden;
  border-bottom: 1px solid var(--color-border);
  box-shadow: var(--shadow-panel);
}

@media (min-width: 640px) {
  .stripped-table {
    margin-left: -1.5rem;
    margin-right: -1.5rem;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }

  .stripped-table__inner {
    border-radius: var(--radius-lg);
  }
}

@media (min-width: 1024px) {
  .stripped-table {
    margin-left: -2rem;
    margin-right: -2rem;
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

/* ------------------------------------------------------------------ */
/* Body cell                                                          */
/* ------------------------------------------------------------------ */

.td {
  padding: 0.5rem;
  white-space: nowrap;
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 500;
  color: var(--color-ink);
}

.td--spacious {
  padding: 1rem 1.5rem;
}

.employee-skills-list__actions {
  display: flex;
  justify-content: flex-end;
}

.employee-skills-list__body {
  color: var(--color-ink-light);
}

.duration-delta--positive {
  color: var(--color-positive);
}

.duration-delta--negative {
  color: var(--color-negative);
}

.tr--surface {
  background-color: var(--color-surface);
}

/* ------------------------------------------------------------------ */
/* Header cell                                                        */
/* ------------------------------------------------------------------ */

.th {
  padding: 0.75rem;
  border-bottom: 1px solid var(--color-border);
  background-color: var(--color-surface-muted);
  font-size: 0.75rem;
  line-height: 1rem;
  font-weight: 500;
  color: var(--color-ink-lighter);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ------------------------------------------------------------------ */
/* Text-align modifiers — shared by .td and .th                       */
/* ------------------------------------------------------------------ */

.td--align-left,
.th--align-left {
  text-align: left;
}

.td--align-center,
.th--align-center {
  text-align: center;
}

.td--align-right,
.th--align-right {
  text-align: right;
}
