/* ### CUSTOM PROPERTIES ### */

:root {
  --ff-roboto: "Roboto", sans-serif;
  --ff-roboto-mono: "Roboto Mono", monospace;
}

/* ### CSS RESET ### */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

table {
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  width: 50%;
  min-width: 800px;
}

td,
th {
  text-align: start;
  padding: 0.9rem 1.6rem;
}

button[type] {
  font-size: inherit;
  padding: 0.4rem 0.8rem;
  cursor: pointer;
}

/* ### UTILITY CLASS ### */

.numerical {
  text-align: end;
}

/* ### GENERAL STYLING ### */

body {
  font-family: var(--ff-roboto);
  font-size: 1.125rem;
}

main {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
  align-items: center;
  padding: 1rem;
}

h1 {
  margin-bottom: 1.5rem;
}

/* ### LIBRARY TABLE ### */

table {
  background-color: #f5f7fd;
  margin-inline: auto;
  border-radius: 0.8rem;
  border: 1px solid #dae1f8;
}

th {
  border-bottom: 2px solid #dae1f8;
  font-size: 1.235rem;
  font-weight: 500;
}

th button[type="button"] {
  font-size: 1.125rem;
}

th.has-btn,
td.has-btn {
  text-align: end;
}

td {
  border-bottom: 1px solid #dae1f8;
}

caption {
  margin-bottom: 1rem;
}

tbody tr:last-child td {
  border-bottom: 0;
}

td.numerical {
  font-family: var(--ff-roboto-mono);
  font-size: 1rem;
}

/* ### DIALOG ### */

dialog {
  padding: 3.5rem 2rem 2rem;
  margin: auto;
  width: 350px;
  position: relative;
}

dialog::backdrop {
  background-color: gray;
  opacity: 0.3;
}

dialog .close-btn svg {
  max-width: 100%;
}

button.close-btn {
  padding: 0;
  border: 0;
  background-color: inherit;
  text-align: center;
  position: absolute;
  top: 10px;
  right: 10px;
  width: 35px;
  margin-left: auto;
}

dialog form {
  display: flex;
  flex-direction: column;
  gap: 1.325rem;
}

dialog form input {
  margin-top: 0.5rem;
  display: block;
  width: 100%;
  padding: 0.5rem 1rem;
  font-size: inherit;
}

dialog form button {
  align-self: flex-start;
}

.error-msg {
  color: lightcoral;
}
