.textinput,
.searchinput {
  position: relative;
  width: 100%;
  background-color: white;
  border-radius: 8px;
  outline: 2px solid #a7b8c6;
  outline-offset: -2px;
  transition: outline-color 0.2s ease-in-out;

  label {
    display: block;
    padding-top: 8px;
    padding-left: 14px;
    font-weight: 700;
    font-size: 0.6875em;
    color: #000000;
  }

  input[type="text"],
  input[type="number"],
  input[type="email"],
  input[type="password"],
  input[type="date"],
  textarea {
    display: block;
    width: 100%;
    padding: 0 14px 8px;
    outline: none;
    border: none;
    font-size: 0.8125em;
    resize: none;

    &::placeholder {
      color: #cdcdcd;
    }
  }

  textarea {
    padding-top: 2px;
  }

  &:has(input:focus) {
    outline-color: #3069b3;
  }

  &:has(input[readonly]) {
    background-color: #c7d1d9;
    pointer-events: none;
    /* outline-color: #b0b6cd; */
    /* opacity: 80%; */
  }
}

.searchinput {
  .searchinput-results {
    position: absolute;
    padding: 8px;
    border-radius: 12px;
    top: calc(100% + 6px);
    left: 0;
    width: 100%;
    background: white;
    border: 1px solid #a7b8c6;
    z-index: 10;
    max-height: 300px;
    overflow-y: auto;
    box-shadow: 0 3px 2px rgba(32, 32, 32, 0.2);

    > * {
      padding: 8px 12px;
      cursor: pointer;
      border-radius: 8px;

      &:hover {
        background-color: #c7d1d9;
        /* color: white; */
      }
    }
  }
}

.external-label {
  display: block;
  font-weight: 700;
  font-size: 0.6875em;
  color: #000000;
  margin-bottom: 6px;
}

.button {
  border-radius: 5px;
  padding: 8px 16px;
  font-weight: 500;
  font-size: 13px;
  cursor: pointer;

  &.primary {
    background-color: #3069b3;
    color: white;
  }

  &.secondary {
    background-color: #e4e5ee;
    color: #353232ff;
  }

  &.danger {
    background-color: #e33143;
    color: #fad2d2ff;

    &:hover {
      color: white;
    }
  }
}

.dotted-underline {
  text-decoration: underline;
  text-decoration-style: dotted;
}

@keyframes modalEnter {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes modalDialogEnter {
  from {
    opacity: 0;
    transform: translate(-50%, calc(-50% + 120px));
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%);
  }
}

.modal {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(5px);
  animation: modalEnter 0.4s ease forwards;
  z-index: 5;
}

.modal .dialog {
  position: fixed;
  top: 50%;
  left: 50%;
  background: white;
  border-radius: 6px;
  max-width: 90%;
  max-height: 90%;
  overflow: auto;
  padding: 24px;

  animation: modalDialogEnter 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55)
    forwards;
}

.search-layout {
  thead {
    background-color: #fff;
  }
}
