/*******************************************************************************
 * COLOURS
 ******************************************************************************/

:root {
  --color-fg: #252525;
  --color-mg1: #8a8a8a;
  --color-mg1--highlighted: #929292;
  --color-mg2: #d1d1d1;
  --color-mg2--highlighted: #c5c5c5;
  --color-bg: #F5F5F5;
  --color-accent1: #046A38;
  --color-accent1-highlighted: ##003a1e;
  --color-accent2: #FBDD40;
  --color-accent2-highlighted: #ebcb2e;
  --color-status-info: #1178b4;
  --color-status-info-highlighted: #09476b;
  --color-status-good: #046A38;
  --color-status-good-highlighted: #003a1e;
  --color-status-danger: #960000;
  --color-status-danger-highlighted: #640000;
  --color-status-warning: #FBDD40;
  --color-status-warning-highlighted: #ebcb2e;
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-fg: #F5F5F5;
    --color-mg1: #8a8a8a;
    --color-mg1--highlighted: #9b9b9b;
    --color-mg2: #353535;
    --color-mg2--highlighted: #4d4d4d;
    --color-bg: #1d1f21;
    --color-accent1: #A4D65E;
    --color-accent1-highlighted: #b9e778;
    --color-accent2: #ffe877;
    --color-accent2-highlighted: #ffef9d;
    --color-status-info: #56cfff;
    --color-status-info-highlighted: #93e0ff;
    --color-status-good: #A4D65E;
    --color-status-good-highlighted: #b9e778;
    --color-status-danger: #ff6f6f;
    --color-status-danger-highlighted: #fd8d8d;
    --color-status-warning: #ffe877;
    --color-status-warning-highlighted: #ffef9d;
  }
}

html {
  font-size: 100%;
}

html,
body {
  background-color: var(--color-bg);
  color: var(--color-fg);
}

h1 {
  color: var(--color-accent1);
}

a {
  color: var(--color-status-info);
  text-decoration: none;
  transition: color 0.1s linear;
}

a:hover {
  color: var(--color-status-info-highlighted);
}

small {
  color: var(--color-mg1);
}

.color--accent1 {
  color: var(--color-accent1);
}

.background-color--accent1 {
  background-color: var(--color-accent1);
}

.color--accent2 {
  color: var(--color-accent2);
}

.background-color--accent2 {
  background-color: var(--color-accent2);
}

.color--status--info {
  color: var(--color-status-info);
}

.background-color--status--info {
  background-color: var(--color-status-info);
}

.color--status--good {
  background-color: var(--color-status-good);
}

.background-color--status--good {
  background-color: var(--color-status-good);
}

.color--status--danger {
  color: var(--color-status-danger);
}

.background-color--status--danger {
  background-color: var(--color-status-danger);
}

.color--status--warning {
  color: var(--color-status-warning);
}

.background-color--status--warning {
  background-color: var(--color-status-warning);
}

/*******************************************************************************
 * FONTS
 ******************************************************************************/

html {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

/*******************************************************************************
 * LAYOUT
 ******************************************************************************/

html {
  box-sizing: border-box;
}

*, *:before, *:after {
  box-sizing: inherit;
}

html,
body {
  min-height: 100vh;
  margin: 0;
  padding: 0;
}

body {
  display: flex;
  flex-direction: column;
}

header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;

  width: 100%;
  max-width: 1200px;
  padding: 0 16px;
  margin: 24px auto;
}

.header__center {
  grid-column-start: 2;
  text-align: center;
}

.header__right {
  text-align: right;
}

header h1 {
  margin: 0;
}

main {
  flex: 1;

  width: 100%;
  max-width: 1200px;
  padding: 0 16px;
  margin: auto;
}

footer {
  padding: 0 16px;
  margin: 24px 0;
}

.footer__copyright {
  font-size: 0.8em;
  text-align: center;
}

section {
  margin: 48px 0;
}

section > h2 {
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 4px solid var(--color-mg1);
}

.text--centered {
  text-align: center;
}

pre {
  padding: 8px;
  margin: 8px;
  border-radius: 4px;
  overflow-x: auto;

  background-color: var(--color-mg2);
}

.undisplayed {
  display: none;
}

.hidden {
  visibility: hidden;
}

/*******************************************************************************
 * TABLES
 ******************************************************************************/

table {
  border: 2px solid var(--color-mg2);
  border-collapse: collapse;
}

table.table--full-width {
  width: 100%;
}

table td,
table th {
  padding: 4px 8px;

  border: 1px solid var(--color-mg1);
}

table th {
  border: 1px solid var(--color-fg);

  font-weight: bold;

  color: var(--color-bg);
  background-color: var(--color-mg1)
}

table tr:nth-child(even) {
  background-color: var(--color-bg);
}

table tr:nth-child(odd) {
  background-color: var(--color-mg2);
}

table td {
  border-top: 1px solid var(--color-mg2);
}

table .table__td--truncated {
  max-width: 384px;

  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/*******************************************************************************
 * RECORDS TABLE
 ******************************************************************************/

 div.table-records__wrapper {
  display: block;
  overflow-x: auto;
}

table.table-records thead {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 1;
}

table.table-records tr.table-records--tr--selected:nth-child(even) {
  background-color: var(--color-accent2);
}

table.table-records tr.table-records--tr--selected:nth-child(odd) {
  background-color: var(--color-accent2-highlighted);
}

@media (prefers-color-scheme: dark) {
  table.table-records tr.table-records--tr--selected {
    color: var(--color-bg);
  }
}

/*******************************************************************************
 * LINK BUTTON
 ******************************************************************************/

.link-button {
  display: inline-block;

  padding: 4px;
  margin: 4px;
}

.link-button--danger {
  color: var(--color-status-danger);
}

.link-button--danger:hover {
  color: var(--color-status-danger-highlighted);
}

/*******************************************************************************
 * FLASH CONTAINER
 ******************************************************************************/

.flash--container {
  padding: 16px 8px;
  border-radius: 4px;

  font-weight: bold;

  color: var(--color-bg);
}

/*******************************************************************************
 * PAGINATION
 ******************************************************************************/

 ul.pagination {
  display: inline-flex;

  margin-top: 8px;
  margin-bottom: 8px;
  padding: 0;

  list-style: none;
}

li.pagination__item:first-child .pagination__link {
  border-top-left-radius: 4px;
  border-bottom-left-radius: 4px;
}

li.pagination__item:last-child .pagination__link {
  border-top-right-radius: 4px;
  border-bottom-right-radius: 4px;
}

.pagination__link {
  display: inline-block;

  margin: 0;
  padding: 8px;

  text-decoration: none;

  border: 1px solid var(--color-mg1);

  transition: background-color 0.1s ease-in;
}

a.pagination__link:hover {
  background-color: var(--color-mg2);
}

.pagination__item--current .pagination__link {
  color: var(--color-fg);
  background-color: var(--color-mg1);
}

/*******************************************************************************
 * PROFILE
 ******************************************************************************/

.profile {
  display: flex;
  flex-direction: row;
  justify-content: flex-end;
  align-items: center;
}

.profile__avatar {
  height: 32px;
  width: auto;
  margin: 8px;
  border-radius: 50%;
}
