:root {
  --primar-light: #f1f5f9;
  --primar-dark: #0f172a;
  --main: #766df4;
  --action: #06b6d4;
}

body {
  font: 14px "Lucida Grande", Helvetica, Arial, sans-serif;
  margin: 0;
  color: var(--primar-dark);
  background-color: var(--primar-light);
}

main {
  padding: 12px;
}

#h1-index {
  margin: auto;
  margin-bottom: 8px;
  text-transform: uppercase;
  font-size: 3em;
}

a {
  cursor: pointer;
  text-decoration: none;
  color: #06b6d4;
}

main > nav {
  display: flex;
  flex-direction: row;
  justify-content: space-around;
  margin: auto;
  position: fixed;
  width: 100%;
  bottom: 0;
  right: 0;
  padding: 1em 0;
  background-color: var(--primar-light);
  box-shadow: 0px 8px 20px 0px var(--primar-dark);
  border-radius: 8px 8px 0 0;
}

main > nav > button {
  height: auto;
  width: 8rem;
}

main > nav > button:nth-child(1) {
  order: 1;
}

#option-container {
  margin: 1.5rem auto;
  /* width: 75%; */
}

#summary-container {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  overflow: scroll;
  justify-content: space-between;
  margin: 1rem 0px;
  padding-bottom: 4px;
  width: 100%;
  /* align-items: center; */
  gap: 1rem;
}

.summary-item {
  padding: 18px;
  /* height: 64px; */
  /* background-color: purple; */
  border-color: var(--main);
  border-width: thin;
  border-style: solid;
  border-radius: 1em;
}

.summary-item > div {
  width: 9em;
}

.summary-item > div:nth-child(1) {
  font-weight: 300;
}

.summary-item > div:nth-child(2) {
  font-weight: 700;
  font-size: 1.5rem;
}

.summary-item > div:nth-child(3) {
  margin-top: 0.5rem;
  font-weight: 100;
  font-size: 0.75rem;
}

.summary-item > div:nth-child(4) {
  font-weight: 400;
  font-size: 1rem;
}

#detail-container {
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  margin-bottom: 3rem;
}

#detail-container table {
  width: 100%;
}

button {
  border: 2px solid var(--action);
  border-radius: 5px;
  background-color: var(--action);
  cursor: pointer;
  padding: 4px;
  font-size: 18px;
  width: 64px;
}

.button-main {
  border: 2px solid var(--action);
  border-radius: 5px;
  background-color: var(--action);
  cursor: pointer;
  padding: 4px;
  font-size: 18px;
  width: 64px;
}

.button-secondary {
  border: 2px solid var(--action);
  border-radius: 5px;
  background-color: var(--primar-light);
  cursor: pointer;
}

.button-secondary:active {
  background-color: var(--action);
}

.button-loader {
  display: inline-block;
  vertical-align: middle;
  margin: 0 4px;
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background: conic-gradient(#0000 10%, #766df4);
  mask: radial-gradient(farthest-side, #0000 calc(100% - 4px), #000 0);
  animation: s3 1s infinite linear;
}

.button-loader.htmx-indicator {
  display: none;
}

.htmx-request.button-loader.htmx-indicator {
  display: inline-block;
}

@keyframes s3 {
  to {
    transform: rotate(1turn);
  }
}

input {
  border-radius: 4px;
  /* font-size: 1.5em; */
  height: 2rem;
  padding-left: 4px;
  background-color: var(--primar-light);
  border-color: var(--primar-light);
  border-width: 1px;
  color: var(--primar-dark);
  font-size: 18px;
}

select {
  border-radius: 4px;
  /* font-size: 1.5em; */
  height: 2rem;
  padding-left: 4px;
  background-color: var(--primar-light);
  border-color: var(--main);
  border-width: 1px;
  color: var(--primar-dark);
}

#add-form {
  width: auto;
  margin: 1rem;
}

#add-form button[type="button"]:nth-child(1) {
  background-color: transparent;
  border-color: #dc2626;
  color: var(--primar-dark);
}

#add-form button[type="button"]:nth-child(1):active {
  background-color: #dc2626;
  color: var(--primar-light);
}

#add-form button[type="button"]:nth-child(n + 2) {
  background-color: transparent;
  border-color: var(--main);
  color: var(--primar-dark);

  float: right;
  margin-left: 5px;
}

#add-form button[type="button"]:nth-child(n + 2):active {
  background-color: var(--main);
  color: var(--primar-light);
}

#add-form > button[type="submit"] {
  float: right;
}

#title-add-form {
  width: auto;
  margin: 1rem;
}

#add-form::after {
  clear: both;
  content: "";
  display: block;
}

#global-loader {
  position: fixed;
  height: 8px;
  width: 100%;
  background: linear-gradient(#22c55e 0 0), linear-gradient(#86efac 0 0),
    #e4e4ed;
  background-size: 60% 100%;
  background-repeat: no-repeat;
  animation: p6 2.5s infinite;
}

@keyframes p6 {
  0% {
    background-position: -150% 0, -150% 0;
  }
  66% {
    background-position: 250% 0, -150% 0;
  }
  100% {
    background-position: 250% 0, 250% 0;
  }
}

#container-401 {
  position: absolute;
  width: 100%;
  height: 100%;
}

#container-401 > h1 {
  font-size: 2rem;
  margin: 4rem auto;
  width: 50%;
  height: 100%;
  text-align: center;
  vertical-align: middle;
}

#error-dialog {
  display: none;
  position: fixed;
  width: 80%;
  background-color: #fecaca;
  margin: 1rem;
  padding: 1rem;
  border-radius: 4px;

  font-size: 12px;
  font-weight: 100;
  word-wrap: break-word;
}

#error-dialog button {
  float: right;
}

#error-dialog.display {
  display: block;
  animation: zoomIn 0.1s ease;
}

#error-dialog.closing {
  animation: zoomOut 0.1s ease;
}

@keyframes zoomIn {
  0% {
    transform: scale(0);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes zoomOut {
  0% {
    transform: scale(1);
  }
  100% {
    transform: scale(0);
  }
}

#detail-container h2 {
  font-size: 1.75rem;
  margin: 0;
}

#detail-container > div {
  margin: 8px 0 28px 0;
}

/* Table Debit */
table > thead > tr {
  display: none;
}

table > tbody {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

table > tbody > tr {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  padding: 8px 0 0 0;
  border-style: solid;
  border-width: 0 0 1px 0;
  border-color: black;
}

#tx-debit > tbody > tr > td:nth-child(1) {
  text-align: right;
  align-self: flex-end;
  margin-top: 10px;
}

#tx-debit > tbody > tr > td:nth-child(2) {
  order: -1;
  width: 100%;
  font-size: 1rem;
  margin-bottom: 4px;
}

#tx-debit > tbody > tr > td:nth-child(3) {
  order: -1;
  font-size: 1rem;
  font-weight: bold;
  align-self: flex-end;
  width: 7rem;
  text-align: right;
}

#tx-credit > tbody > tr > td:nth-child(3) {
  text-align: right;
  align-self: flex-end;
  margin-top: 10px;
  order: 3;
}

#tx-credit > tbody > tr > td:nth-child(2) {
  order: 1;
  width: 100%;
  font-size: 1rem;
  margin-bottom: 4px;
}

#tx-credit > tbody > tr > td:nth-child(1) {
  order: 2;
  font-size: 1rem;
  font-weight: bold;
  align-self: flex-end;
  width: 7rem;
  text-align: right;
}
