:root {
  --color-primary: #006aff;
  --color-primary-hover: #0155dd;
  --color-primary-light: #e6eefc;

  --color-success: #87d068;
  --color-success-hover: #7abd5d;
  --color-success-light: #efffe8;

  --color-default: #eee;
  --color-default-hover: #e7e3e3;
  --color-default-light: #f2f2f2;
  --color-default-border: #c5c5c5;

  --color-text: #333;
  --color-text-dim: #666;

  --color-error: #ff0000;
  --color-error-hover: #dd0303;
  --color-error-light: #ffecec;

  --color-warning: #fadb14;
  --color-warning-hover: #dacb01;
  --color-warning-light: #fffddf;
}

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

body {
  -moz-osx-font-smoothing: grayscale;
  -webkit-font-smoothing: antialiased;
  color: var(--color-text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
    'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
    sans-serif;
  font-size: 16px;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 500;
}

.heading {
  border-radius: 3px;
}

.button,
.input,
.link {
  font-size: 15px;
}

.button,
.input {
  background: none;
  border-radius: 3px;
  border: 1px solid var(--color-default-border);
  padding: 0.45rem 0.85rem;
}

.input {
  padding: 0.5rem 0.6rem;
}

p {
  line-height: 1.5;
  color: var(--color-text-dim);
}

/* Stack */

.stack,
.stack-row {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
}

.stack-column {
  display: flex;
  flex-direction: column;
}

.stack-row > * {
  margin: 0 0.5rem;
}

.stack-row > *:first-child {
  margin-left: 0;
}

.stack-row > *:last-child {
  margin-right: 0;
}

.stack-column > * {
  margin: 0.5rem 0;
}

.stack-column > *:first-child {
  margin-top: 0;
}

.stack-column > *:last-child {
  margin-bottom: 0;
}

.stack-row-large > * {
  margin: 0 1rem;
}

.stack-column-large > * {
  margin: 1rem 0;
}

.stack-row-small > * {
  margin: 0 0.25rem;
}

.stack-column-small > * {
  margin: 0.25rem 0;
}

/* Button */

.button {
  cursor: pointer;
  color: var(--color-text-dim);
  transition: 0.2s ease-out 0s;
}
.button:hover {
  background: var(--color-default);
  transition: 0.2s ease-out 0s;
}
.button:disabled:hover {
  background: none;
}
.button-primary {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: white;
  font-weight: 500;
}
.button-primary:hover {
  background: var(--color-primary-hover);
  border-color: var(--color-primary-hover);
}
.button-primary:disabled:hover {
  background: var(--color-primary);
  border-color: var(--color-primary);
}
.button-success {
  background: var(--color-success);
  border-color: var(--color-success);
  color: white;
  font-weight: 500;
}
.button-success:hover {
  background: var(--color-success-hover);
  border-color: var(--color-success-hover);
}
.button-success:disabled:hover {
  background: var(--color-success);
  border-color: var(--color-success);
}
.button-error {
  background: var(--color-error);
  border-color: var(--color-error);
  color: white;
  font-weight: 500;
}
.button-error:hover {
  border-color: var(--color-error-hover);
  background: var(--color-error-hover);
  color: white;
}
.button-error:disabled:hover {
  background: var(--color-error);
  border-color: var(--color-error);
}
.button-link {
  color: var(--color-primary);
  border: none;
}
.button-link:hover {
  color: var(--color-primary-hover);
  background: none;
}
.button-small {
  font-size: 0.85em;
  padding: 0.35rem 0.5rem;
  font-weight: 500;
}
.button-small.button-error.button-success.button-primary {
  font-weight: bold;
}
.button-large {
  font-size: 1.1em;
  padding: 0.5rem 1rem;
}
.button-content {
  height: 100%;
  width: 100%;
  position: relative;
}
.button-value {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.button-content .button-spinner {
  position: absolute;
  top: 0;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  -webkit-animation: fadeIn 0.2s ease-in-out;
  animation: fadeIn 0.2s ease-in-out;
}
.button:disabled {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  cursor: not-allowed;
  opacity: 0.75;
}

/* Card */
.card {
  background: white;
  border-radius: 3px;
  border: 1px solid var(--color-default);
  box-shadow: 0 5px 10px rgba(0, 0, 0, 0.05);
  padding: 1rem;
}

/* Modal */

.modal-wrapper {
  margin: 0;
  align-items: flex-start;
  display: flex;
  height: 100vh;
  justify-content: center;
  left: 0;
  overflow-y: auto;
  padding: 20vh 0;
  position: fixed;
  top: 0;
  width: 100vw;
  z-index: 3;
}
.modal-click-surface {
  height: 100vh;
  left: 0;
  position: fixed;
  top: 0;
  width: 100vw;
  z-index: 3;
}
.modal-window {
  background: white;
  border-radius: 3px;
  width: 100%;
  min-width: 300px;
  max-width: 500px;
  z-index: 4;
}
.modal-header {
  padding: 1rem;
}
.modal-content {
  padding: 1.5rem;
}

/* Dropdown */

.dropdown-wrapper {
  position: relative;
  width: -webkit-max-content;
  width: -moz-max-content;
  width: max-content;
  white-space: nowrap;
}
.dropdown-menu {
  position: absolute;
  background: white;
  border-radius: 3px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.125);
  -webkit-animation: fadeIn 0.2s ease-in-out;
  animation: fadeIn 0.2s ease-in-out;
  overflow-y: auto;
  z-index: 2;
  top: 120%;
  left: 0;
}
.dropdown-value {
  flex: 1;
}
.dropdown-icon {
  opacity: 0.5;
  font-size: 1.1em;
  transform: translateY(1px);
  margin-left: 1rem;
}
.dropdown-item {
  padding: 0.75rem 1rem;
  font-size: 0.875em;
  cursor: pointer;
}
.dropdown-item:hover,
.dropdown-item-active {
  background: var(--color-default);
}
.dropdown-item-error {
  color: red;
}
.dropdown-item:last-child {
  border: none;
}

/* Popover */

.popover-wrapper {
  position: relative;
  width: -webkit-max-content;
  width: -moz-max-content;
  width: max-content;
  white-space: nowrap;
}

.popover-content {
  position: absolute;
  background: white;
  border-radius: 3px;
  box-shadow: 0 5px 30px rgba(0, 0, 0, 0.2);
  padding: 1rem;
  left: 50%;
  bottom: 120%;
}

/* Popconfirm */

.popconfirm-wrapper {
  position: relative;
  width: -webkit-max-content;
  width: -moz-max-content;
  width: max-content;
}

.popconfirm-content {
  min-width: 250px;
  max-width: 300px;
  position: absolute;
  background: white;
  border-radius: 3px;
  box-shadow: 0 5px 30px rgba(0, 0, 0, 0.2);
  padding: 1rem;
  left: 50%;
  bottom: 120%;
}

.popconfirm-content h4 {
  line-height: 1.5;
  font-size: 0.875em;
  color: var(--color-text-dim);
}

/* Utilities */

.block {
  display: block;
  width: 100%;
}
.grid {
  display: grid;
  width: 100%;
}
.divider {
  width: 100%;
  opacity: 0.25;
}
.divider-small {
  margin: 0.5rem 0;
}
.divider-medium {
  margin: 1rem 0;
}
.divider-large {
  margin: 2rem 0;
}
.link {
  color: var(--color-primary);
  cursor: pointer;
}
.link:hover {
  color: var(--color-primary-hover);
  cursor: pointer;
}
.dashed {
  border-style: dashed;
}

/* Toast */

.toasts {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translate3d(-50%, -2rem, 0);
  z-index: 4;
}
.toast {
  padding: 1rem;
  border-radius: 3px;
  color: white;
  background: var(--color-text);
  display: flex;
  align-items: center;
  line-height: 1;
}
.toast span {
  cursor: pointer;
  margin-left: 1rem;
  font-size: 0.875em;
  opacity: 0.5;
}
.toasts span:hover {
  opacity: 1;
}
.toast-success {
  background: var(--color-success);
}
.toast-primary {
  background: var(--color-primary);
}
.toast-warning {
  background: var(--color-warning);
  color: var(--color-text);
}
.toast-error {
  background: red;
}

/* Table */

.table {
  border-collapse: collapse;
  text-align: left;
  width: 100%;
}

.table td,
.table th {
  border: 1px solid var(--color-default);
  text-align: left;
  padding: 1rem;
  font-size: 0.875em;
}

/* Tooltip */

.tooltip-wrapper {
  position: relative;
}

.tooltip {
  background: var(--color-text);
  border-radius: 3px;
  box-shadow: 0 5px 10px rgba(0, 0, 0, 0.05);
  color: white;
  font-size: 0.875em;
  padding: 0.5rem;
  position: absolute;
  white-space: nowrap;
  bottom: 130%;
  left: 50%;
}

.code-block {
  width: 100%;
  font-size: 0.875em;
  line-height: 1.5;
}
.code-block > div {
  padding: 1rem;
}
.code-block-inline {
  line-height: 1;
  background-color: var(--color-default);
  padding: 0.5rem;
  border-radius: 3px;
  font-size: 0.875em;
}

/* Checkbox */

.checkbox-container {
  -moz-user-select: none;
  -ms-user-select: none;
  -webkit-user-select: none;
  align-items: center;
  cursor: pointer;
  display: block;
  display: flex;
  height: 20px;
  padding-left: 2rem;
  position: relative;
  user-select: none;
}

.checkbox-container .checkbox-label {
  font-size: 0.875em;
}

.checkbox-container input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}

.checkbox-checkmark {
  position: absolute;
  top: 0;
  left: 0;
  height: 20px;
  width: 20px;
  border: 1px solid #ddd;
  border-radius: 3px;
}

.checkbox-container:hover input ~ .checkbox-checkmark {
  border-color: var(--color-primary);
}

.checkbox-container-active input ~ .checkbox-checkmark {
  border-color: var(--color-primary);
}

.checkbox-container input:checked ~ .checkbox-checkmark {
  border-color: var(--color-primary);
  background-color: var(--color-primary);
  -webkit-animation: fadeIn 0.2s ease-in-out;
  animation: fadeIn 0.2s ease-in-out;
}

.checkbox-checkmark:after {
  content: '';
  position: absolute;
  display: none;
}

.checkbox-container input:checked ~ .checkbox-checkmark:after {
  display: block;
}

.checkbox-container .checkbox-checkmark:after {
  left: 6px;
  top: 2px;
  width: 4px;
  height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  -webkit-animation: fadeIn 0.2s ease-in-out;
  animation: fadeIn 0.2s ease-in-out;
}

/* Select */

.select-wrapper {
  position: relative;
  width: -webkit-max-content;
  width: -moz-max-content;
  width: max-content;
  white-space: nowrap;
}

.select-wrapper button {
  text-align: left;
}

.select-menu {
  width: 100%;
  position: absolute;
  background: white;
  border-radius: 3px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.125);
  z-index: 2;
  top: 120%;
  left: 0;
}
.select-item {
  padding: 0.75rem 1rem;
  font-size: 0.875em;
  cursor: pointer;
}
.select-item-selected {
  background: var(--color-primary-light);
  font-weight: 500;
}
.select-item:hover {
  background: var(--color-default);
}
.select-item:last-child {
  border: none;
}
.select-item-active {
  background: var(--color-default);
}

/* Input */

.input-wrapper {
  position: relative;
}

.input-icon {
  position: absolute;
  left: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
}

.input-wrapper input,
.input-wrapper textarea {
  padding-left: 2.35rem;
}

/* Autocomplete */

.autocomplete-wrapper {
  position: relative;
  display: inline-block;
}
.autocomplete-results {
  position: absolute;
  width: 100%;
  top: 100%;
  left: 0;
  z-index: 2;
  overflow-y: auto;
  max-height: 200px;
  border-bottom-left-radius: 3px;
  border-bottom-right-radius: 3px;
  background: white;
  box-shadow: 0 5px 20px 10px rgba(0, 0, 0, 0.075);
  -webkit-animation: fadeIn 0.2s ease-in-out;
  animation: fadeIn 0.2s ease-in-out;
}
.autocomplete-result {
  padding: 0.5rem 0.75rem;
  cursor: pointer;
}
.autocomplete-result-active {
  background: var(--color-default);
}
.autocomplete-result:hover {
  background: var(--color-default);
}
.autocomplete-result:last-child {
  border: none;
}

/* Avatar */

.avatar {
  align-items: center;
  background-color: var(--color-default);
  background-position: center;
  background-size: cover;
  border-radius: 50%;
  color: var(--color-text-dim);
  display: flex;
  font-size: 1.2em;
  font-weight: 500;
  height: 50px;
  justify-content: center;
  width: 50px;
}

.avatar-square {
  border-radius: 3px;
}

/* Tag */

.tag {
  background: var(--color-default-light);
  border-radius: 3px;
  border: 1px solid var(--color-default-border);
  color: var(--color-text-dim);
  font-size: 0.75em;
  padding: 0.25rem 0.5rem;
}
.tag-primary {
  background: var(--color-primary-light);
  border-color: var(--color-primary);
  color: var(--color-primary);
  font-weight: 500;
}
.tag-warning {
  background: var(--color-warning-light);
  border-color: var(--color-warning);
  color: var(--color-text);
  font-weight: 500;
}
.tag-error {
  background: var(--color-error-light);
  border-color: var(--color-error);
  color: var(--color-error);
  font-weight: 500;
}
.tag-success {
  background: var(--color-success-light);
  border-color: var(--color-success);
  color: var(--color-success);
  font-weight: 500;
}

/* Progress */

.progress-wrapper > * {
  margin-top: 0;
  margin-bottom: 0;
  padding-top: 0;
  padding-bottom: 0;
  line-height: 1;
}
.progress {
  background: var(--color-default);
  height: 0.5rem;
  width: 100%;
  border-radius: 50px;
}
.progress-content {
  background: var(--color-primary);
  height: 100%;
  max-width: 100%;
  border-radius: 50px;
}
.progress-content-done {
  background: var(--color-success);
}

/* Spinner */
.spinner {
  height: 50px;
  width: 50px;
  border: 4px solid var(--color-default-border);
  border-right-color: rgba(255, 255, 255, 0) !important;
  border-top-color: rgba(255, 255, 255, 0) !important;
  -webkit-animation-name: spin;
  animation-name: spin;
  -webkit-animation-duration: 0.5s;
  animation-duration: 0.5s;
  -webkit-animation-timing-function: linear;
  animation-timing-function: linear;
  -webkit-animation-iteration-count: infinite;
  animation-iteration-count: infinite;
  border-radius: 50%;
}
.spinner-small {
  border-width: 2px;
  height: 18px;
  width: 18px;
}
.spinner-large {
  border-width: 5px;
  height: 75px;
  width: 75px;
}
.spinner-primary {
  border-color: var(--color-primary);
}
.spinner-success {
  border-color: var(--color-success);
}
.spinner-error {
  border-color: var(--color-error);
}
@-webkit-keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}
@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Notification */
.notifications {
  padding: 1rem;
  position: fixed;
  z-index: 4;
  right: 0;
  top: 0;
}
.notification {
  padding: 16px;
  border-radius: 3px;
  box-shadow: 0 5px 20px 10px rgba(0, 0, 0, 0.075);
  background-color: white;
  max-height: 300px;
  overflow-y: auto;
  width: 350px;
}
.notification p {
  font-size: 0.875em;
}
.notification-primary {
  border-left: 3px solid var(--color-primary);
}
.notification-warning {
  border-left: 3px solid var(--color-warning-hover);
}
.notification-error {
  border-left: 3px solid var(--color-error);
}
.notification-success {
  border-left: 3px solid var(--color-success);
}

/* Message */

.messages {
  padding: 1rem;
  position: fixed;
  z-index: 4;
  left: 50%;
  transform: translateX(-50%);
  top: 0;
}
.message {
  background-color: white;
  border-radius: 3px;
  box-shadow: 0 5px 20px 10px rgba(0, 0, 0, 0.075);
  color: var(--color-text-dim);
  font-size: 0.875em;
  overflow-y: auto;
  padding: 16px;
  min-width: 150px;
  max-width: 250px;
}

/* Badge */
.badge-wrapper {
  position: relative;
}
.badge {
  align-items: center;
  -webkit-animation: fadeIn 0.2s ease-in-out;
  animation: fadeIn 0.2s ease-in-out;
  background: var(--color-error);
  border-radius: 50px;
  color: white;
  display: flex;
  font-size: 0.8em;
  font-weight: bold;
  justify-content: center;
  line-height: 1;
  min-height: 1.25rem;
  min-width: 1.5rem;
  padding: 0rem 0.35rem;
  position: absolute;
  right: 0;
  top: 0;
  transform: translate(50%, -50%);
  z-index: 2;
}
.badge-dot {
  min-height: 10px;
  min-width: 10px;
  padding: 0;
}
.badge-square {
  border-radius: 3px;
}
.badge-primary {
  background: var(--color-primary);
}
.badge-success {
  background: var(--color-success);
}
.badge-warning {
  background: var(--color-warning);
  color: var(--color-text);
}

/* List */

.list {
  list-style-position: inside;
}
.list li {
  margin: 1rem 0;
}
.list li:first-child {
  margin-top: 0;
}
.list li:last-child {
  margin-bottom: 0;
}

/* Text */
.text-error {
  color: var(--color-error);
}
.text-link {
  color: var(--color-primary);
  cursor: pointer;
}
.code {
  border: 1px solid var(--color-default-border);
  background: var(--color-default);
  font-size: 0.8em;
  border-radius: 2px;
  padding: 0.25rem;
}

/* Switch */

.switch-wrapper {
  display: flex;
  cursor: pointer;
}
.switch-container {
  width: 2.75rem;
  background: var(--color-default);
  border: 1px solid var(--color-default);
  border-radius: 50px;
  padding: 2px;
  align-items: center;
  display: flex;
}
.switch-container[data-active='true'] {
  border-color: var(--color-primary);
}
.switch-container-error[data-active='true'] {
  border-color: var(--color-error);
}
.switch-container-success[data-active='true'] {
  border-color: var(--color-success);
}
.switch-handle {
  background: white;
  border-radius: 50%;
  box-shadow: 0 5px 10px rgba(0, 0, 0, 0.05);
  height: 18px;
  width: 18px;
}
.switch-container input {
  display: none;
}
.switch-wrapper .switch-label {
  font-size: 0.875em;
  margin-left: 0.7rem;
}

/* Skeleton */

.skeleton,
.skeleton:hover,
.skeleton:focus {
  outline: none;
  cursor: default;
  box-shadow: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  background-image: none;
  background: linear-gradient(
    90deg,
    var(--color-default-light),
    var(--color-default-hover),
    var(--color-default-light)
  );
  background-size: 600% 600%;
  -webkit-animation: pulse 2s ease infinite;
  animation: pulse 2s ease infinite;
  color: rgba(0, 0, 0, 0);
  user-select: none;
  border: none;
}
.skeleton::-moz-placeholder {
  opacity: 0;
}
.skeleton:-ms-input-placeholder {
  opacity: 0;
}
.skeleton::-ms-input-placeholder {
  opacity: 0;
}
.skeleton::placeholder {
  opacity: 0;
}
.skeleton * {
  opacity: 0;
}

/* Star */
.rating {
  display: flex;
  align-items: center;
}
.rating-star-wrapper {
  transition: 0.2s ease-in-out 0s;
  padding: 0 0.25rem;
}
.rating-star-wrapper[data-read-only='false'] {
  cursor: pointer;
}
.rating-star-wrapper:first-child {
  padding-left: 0;
}
.rating-star-wrapper:last-child {
  padding-right: 0;
}
.rating-star-wrapper[data-read-only='false']:hover {
  transition: 0.2s ease-in-out 0s;
  transform: scale(1.2);
}
.rating-star {
  transition: 0.2s ease-in-out 0s;
  color: var(--color-default-hover);
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  font-size: 1.2em;
}
.rating-star-active {
  transition: 0.2s ease-in-out 0s;
  color: var(--color-warning);
}

/* Drawer */

.drawer-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: 100vw;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: flex-end;
  z-index: 50;
  margin: 0;
}
.drawer-wrapper[data-position='left'] {
  justify-content: flex-start;
}
.drawer-window {
  background-color: white;
  height: 100vh;
  width: 100vw;
}
.drawer-header {
  padding: 1rem;
}
.drawer-content {
  padding: 1rem;
}

/* Animations */

@-webkit-keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@-webkit-keyframes pulse {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}
@keyframes pulse {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}
