@font-face {
  font-family: "Figtree";
  font-style: normal;
  font-display: swap;
  font-weight: 300 900;
  src: url("/resources/fonts/figtree-latin-wght-normal.woff2") format("woff2-variations");
}

:root,
[data-bs-theme=light] {
  /* Brand. */
  --aj-navy: #103f94;
  --aj-navy-dark: #0b2f70;
  --aj-azure: #1e94d1;
  --aj-azure-soft: #e4f3fb;

  /* Surfaces. */
  --aj-page: #f3f6fa;
  --aj-surface: #ffffff;
  --aj-line: #dfe5ee;
  --aj-ink: #17243a;
  --aj-ink-soft: #5b6b82;

  /* Layout. */
  --aj-sidebar-width: 15.5rem;
  --aj-radius: 0.75rem;

  /* Bootstrap. */
  --bs-primary: var(--aj-navy);
  --bs-primary-rgb: 16, 63, 148;
  --bs-success: #1c7c3a;
  --bs-success-rgb: 28, 124, 58;
  --bs-danger: #c22f40;
  --bs-danger-rgb: 194, 47, 64;
  --bs-body-font-family: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --bs-body-font-size: 0.9375rem;
  --bs-body-color: var(--aj-ink);
  --bs-body-bg: var(--aj-surface);
  --bs-secondary-color: var(--aj-ink-soft);
  --bs-border-color: var(--aj-line);
  --bs-link-color: var(--aj-navy);
  --bs-link-color-rgb: 16, 63, 148;
  --bs-link-hover-color: var(--aj-azure);
  --bs-link-hover-color-rgb: 30, 148, 209;
  --bs-border-radius: 0.5rem;
}

body {
  min-height: 100vh;
  background-color: var(--aj-page);
}

h1, h2, h3, h4, h5, h6 {
  line-height: 1.2;
  font-weight: 650;
}

a {
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.icon {
  width: 1em;
  height: 1em;
  flex: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-weight: 600;
}

.btn:hover,
.btn:focus {
  text-decoration: none;
}

.btn-primary {
  --bs-btn-bg: var(--aj-navy);
  --bs-btn-border-color: var(--aj-navy);
  --bs-btn-hover-bg: var(--aj-navy-dark);
  --bs-btn-hover-border-color: var(--aj-navy-dark);
  --bs-btn-active-bg: var(--aj-navy-dark);
  --bs-btn-active-border-color: var(--aj-navy-dark);
  --bs-btn-disabled-bg: var(--aj-navy);
  --bs-btn-disabled-border-color: var(--aj-navy);
  --bs-btn-focus-shadow-rgb: 30, 148, 209;
}

.btn-outline-secondary {
  --bs-btn-color: var(--aj-ink-soft);
  --bs-btn-border-color: var(--bs-border-color);
  --bs-btn-hover-color: var(--aj-ink);
  --bs-btn-hover-bg: var(--aj-page);
  --bs-btn-hover-border-color: var(--bs-border-color);
  --bs-btn-active-color: var(--aj-ink);
  --bs-btn-active-bg: var(--aj-page);
  --bs-btn-active-border-color: var(--bs-border-color);
}

.form-control:focus,
.form-select:focus {
  border-color: var(--aj-azure);
  box-shadow: 0 0 0 0.2rem rgba(30, 148, 209, 0.2);
}

.form-label {
  margin-bottom: 0.3rem;
  font-size: 0.875rem;
  font-weight: 600;
}

.form-control:disabled,
.form-select:disabled {
  background-color: var(--aj-page);
  color: var(--aj-ink-soft);
}

.field-tag {
  margin-left: 0.25rem;
  color: var(--aj-ink-soft);
  font-size: 0.6875rem;
  font-weight: 500;
}

.field-tag-unique {
  color: var(--bs-success);
}

.field-tag-locked {
  color: var(--bs-danger);
}

/* Spinners. */

.page-spinner {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(243, 246, 250, 0.75);
}

.modal-spinner {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--bs-modal-border-radius);
  background-color: rgba(255, 255, 255, 0.8);
}

/* Authenticated layout. */

.app-layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  background-color: var(--aj-surface);
  border-right: 1px solid var(--aj-line);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 1rem 1.25rem;
  color: var(--aj-navy);
  font-size: 1.125rem;
  font-weight: 700;
}

.sidebar-brand:hover {
  text-decoration: none;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  padding: 0.25rem 0.75rem 1rem;
}

.sidebar-group {
  margin: 1rem 0.625rem 0.25rem;
  color: var(--aj-ink-soft);
  font-size: 0.75rem;
  font-weight: 600;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5rem 0.625rem;
  border-radius: var(--bs-border-radius);
  color: var(--aj-ink);
  font-weight: 500;
}

.sidebar-link .icon {
  color: var(--aj-ink-soft);
}

.sidebar-link:hover {
  background-color: var(--aj-page);
  text-decoration: none;
}

.sidebar-link.active {
  background-color: var(--aj-azure-soft);
  color: var(--aj-navy);
  font-weight: 650;
}

.sidebar-link.active .icon {
  color: var(--aj-navy);
}

.app-main {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 4rem;
  padding: 0.5rem 1.5rem;
  background-color: var(--aj-surface);
  border-bottom: 1px solid var(--aj-line);
}

.topbar-title {
  flex: 1;
  min-width: 0;
  margin: 0;
  font-size: 1.25rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-menu {
  --bs-btn-padding-x: 0.5rem;
  color: var(--aj-ink);
  font-size: 1.125rem;
}

.topbar-user {
  --bs-btn-padding-x: 0.375rem;
  --bs-btn-padding-y: 0.25rem;
  --bs-btn-font-weight: 500;
  text-align: left;
}

.topbar-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.125rem;
  height: 2.125rem;
  border-radius: 50%;
  background-color: var(--aj-navy);
  color: #ffffff;
  font-weight: 650;
}

.topbar-user-name {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.topbar-user-name small {
  color: var(--aj-ink-soft);
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.dropdown-item:hover {
  text-decoration: none;
}

.app-content {
  width: 100%;
  max-width: 75rem;
  margin: 0 auto;
  padding: 1.5rem;
}

.content-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.content-description {
  margin: 0;
  color: var(--aj-ink-soft);
}

.content-card {
  padding: 1.25rem;
  background-color: var(--aj-surface);
  border: 1px solid var(--aj-line);
  border-radius: var(--aj-radius);
}

.shortcuts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr));
  gap: 1rem;
}

.shortcut {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.25rem;
  background-color: var(--aj-surface);
  border: 1px solid var(--aj-line);
  border-radius: var(--aj-radius);
  color: var(--aj-ink);
  font-weight: 600;
}

.shortcut .icon {
  color: var(--aj-azure);
  font-size: 1.25rem;
}

.shortcut:hover {
  border-color: var(--aj-azure);
  text-decoration: none;
}

/* Tables. */

.table {
  --bs-table-hover-bg: var(--aj-azure-soft);
  margin-bottom: 0 !important;
}

.pagination {
  --bs-pagination-active-bg: var(--aj-navy);
  --bs-pagination-active-border-color: var(--aj-navy);
  --bs-pagination-color: var(--aj-navy);
  --bs-pagination-hover-color: var(--aj-navy);
  --bs-pagination-focus-color: var(--aj-navy);
  --bs-pagination-focus-box-shadow: 0 0 0 0.2rem rgba(30, 148, 209, 0.2);
  --bs-pagination-disabled-bg: var(--aj-surface);
}

.table > thead th {
  color: var(--aj-ink-soft);
  font-size: 0.8125rem;
  font-weight: 600;
  white-space: nowrap;
}

.table > tbody > tr {
  cursor: pointer;
}

.table > tbody > tr:focus-visible {
  outline: 2px solid var(--aj-azure);
  outline-offset: -2px;
}

.table-toolbar,
.table-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.table-toolbar {
  margin-bottom: 0.75rem;
}

.table-footer {
  margin-top: 0.75rem;
  color: var(--aj-ink-soft);
  font-size: 0.875rem;
}

.dataTables_wrapper .dataTables_filter label,
.dataTables_wrapper .dataTables_length label {
  margin: 0;
}

.dataTables_wrapper .dataTables_filter input {
  margin-left: 0 !important;
}

.dataTables_wrapper .dataTables_paginate .pagination {
  margin: 0;
}

.dataTables_wrapper {
  overflow-x: auto;
}

.badge {
  font-weight: 600;
}

.badge-success {
  background-color: #dff3e5;
  color: #17602e;
}

.badge-muted {
  background-color: #e8ecf2;
  color: var(--aj-ink-soft);
}

/* Modals. */

.modal-header,
.modal-footer {
  border-color: var(--aj-line);
}

.modal-title {
  font-size: 1.125rem;
}

/* The alert can be shown on top of the form. */
#divModalAlert {
  z-index: 1065;
}

.alert-modal-success {
  border-top: 4px solid var(--bs-success);
}

.alert-modal-danger {
  border-top: 4px solid var(--bs-danger);
}

/* Public layout. */

.public-layout {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  padding: 2rem 1rem 1rem;
}

.public-brand {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  margin-bottom: 1.25rem;
  color: var(--aj-navy);
  font-size: 1.375rem;
  font-weight: 700;
}

.public-brand:hover {
  text-decoration: none;
}

.public-card {
  width: 100%;
  max-width: 27rem;
  padding: 1.75rem;
  background-color: var(--aj-surface);
  border: 1px solid var(--aj-line);
  border-radius: var(--aj-radius);
}

.public-card.public-card-wide {
  max-width: 48rem;
}

.public-title {
  margin-bottom: 1.25rem;
  font-size: 1.5rem;
}

.public-notice {
  margin: 1.25rem 0 0;
  padding-top: 1rem;
  border-top: 1px solid var(--aj-line);
  font-size: 0.875rem;
  text-align: center;
  color: var(--aj-ink-soft);
}

.public-message {
  text-align: center;
}

.public-message .public-title {
  margin-bottom: 0.75rem;
}

.public-message-image {
  max-height: 10rem;
  margin-bottom: 1rem;
}

.public-message-code {
  margin-bottom: 0.25rem;
  color: var(--aj-azure);
  font-size: 3.5rem;
  font-weight: 700;
  line-height: 1;
}

.public-footer {
  margin-top: auto;
  padding-top: 1.5rem;
  font-size: 0.75rem;
}

.public-footer a {
  color: var(--aj-ink-soft);
}

.btn-inline-icon {
  padding: 0 0.125rem;
  border: 0;
  background: none;
  color: var(--aj-navy);
}

.password-rules {
  padding: 0;
  color: var(--aj-ink-soft);
  font-size: 0.875rem;
  list-style: none;
}

.password-rules-live li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Up to Bootstrap's "lg" breakpoint the sidebar is an offcanvas. */
@media (min-width: 992px) {
  .sidebar {
    position: sticky;
    top: 0;
    flex: none;
    width: var(--aj-sidebar-width);
    height: 100vh;
    overflow-y: auto;

    /* Bootstrap forces the offcanvas to be transparent on large screens. */
    background-color: var(--aj-surface) !important;
  }
}

@media (max-width: 575.98px) {
  .topbar,
  .app-content {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .topbar-user-name {
    display: none;
  }

  .public-card {
    padding: 1.25rem;
  }
}
