/*
 * Fil: /assets/css/tables.css
 * Syfte:
 * - Gemensam tabellbas
 * - Tydligare linjer
 * - Återanvändbara tabellklasser
 */

/* ------------------------------------------------------------
   Bootstrap-tabeller, tydligare linjer
------------------------------------------------------------ */

.table {
  --bs-table-border-color: var(--ft-border-color-soft);
}

.table > :not(caption) > * > * {
  border-bottom-color: var(--ft-border-color-soft);
}

.table thead th {
  border-bottom-color: var(--ft-border-color);
}

/* Extra tydlighet för tabeller som inte fullt följer Bootstrap-variabeln */
.table,
.table th,
.table td {
  border-color: var(--ft-border-color-soft);
}

/* ------------------------------------------------------------
   Standardjusteringar
------------------------------------------------------------ */

.table th,
.table td {
  vertical-align: middle;
}

.table th.num,
.table td.num,
.table th.text-end,
.table td.text-end {
  white-space: nowrap;
}

/* ------------------------------------------------------------
   Tabell i kort
------------------------------------------------------------ */

.card .table {
  margin-bottom: 0;
}

.card .table:first-child thead tr:first-child th:first-child {
  border-top-left-radius: var(--ft-radius-lg);
}

.card .table:first-child thead tr:first-child th:last-child {
  border-top-right-radius: var(--ft-radius-lg);
}

/* ------------------------------------------------------------
   Kompakt tabell
------------------------------------------------------------ */

.table-compact th,
.table-compact td {
  padding-top: .4rem;
  padding-bottom: .4rem;
}

/* ------------------------------------------------------------
   Sticky tabellhuvud
------------------------------------------------------------ */

.table-sticky-head thead th,
.sticky-head thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--bs-body-bg, #fff);
}

/* ------------------------------------------------------------
   Mobilhjälp
------------------------------------------------------------ */

.table-responsive {
  border-color: var(--ft-border-color);
}

/*
 * Använd på celler som absolut inte ska radbrytas.
 */
.table .nowrap,
.table-nowrap th,
.table-nowrap td {
  white-space: nowrap;
}