:root {
  --color-zinc-50: #f1f8f3;
  --color-zinc-100: #e7f0e9;
  --color-zinc-200: #d0dfd4;
  --color-zinc-300: #b4c8b9;
  --color-zinc-400: #91a798;
  --color-zinc-500: #718779;
  --color-zinc-600: #52695b;
  --color-zinc-700: #384b40;
  --color-zinc-800: #26372d;
  --color-zinc-900: #17251d;
  --color-zinc-950: #0b1510;
  --color-indigo-300: #d3f89b;
  --color-indigo-400: #b9ed69;
  --color-indigo-500: #a4dc45;
  --color-indigo-600: #85b932;
  color-scheme: dark;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  background-image:
    radial-gradient(ellipse at 12% 0%, rgb(91 133 65 / 13%), transparent 34rem),
    radial-gradient(ellipse at 92% 18%, rgb(37 93 71 / 12%), transparent 30rem);
  background-attachment: fixed;
}

button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}

button,
a {
  touch-action: manipulation;
}

:focus-visible {
  outline: 2px solid var(--color-indigo-400);
  outline-offset: 3px;
}

header {
  box-shadow: 0 8px 26px rgb(0 0 0 / 12%);
}

header > div > div:first-child > div:first-child,
aside > div:first-child > div:first-child {
  box-shadow: 0 0 22px rgb(164 220 69 / 22%);
}

aside {
  border-color: rgb(145 167 152 / 14%) !important;
  background-color: rgb(16 29 22 / 72%) !important;
}

aside nav a,
header nav a,
button,
main [class*="rounded-2xl"][class*="border"],
main [class*="rounded-xl"][class*="border"] {
  transition:
    color 180ms ease,
    background-color 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease;
}

aside nav a:hover,
header nav a:hover {
  transform: translateY(-1px);
}

main > div > * {
  animation: rise-in 420ms both;
}

main > div > *:nth-child(2) {
  animation-delay: 50ms;
}

main > div > *:nth-child(3) {
  animation-delay: 100ms;
}

main > div > *:nth-child(4) {
  animation-delay: 150ms;
}

main h1 {
  color: var(--color-zinc-50);
  font-size: clamp(1.55rem, 5vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.15;
}

main h2 {
  color: var(--color-zinc-100);
  letter-spacing: -0.02em;
}

main [class*="rounded-2xl"][class*="border"],
main [class*="rounded-xl"][class*="border"] {
  border-color: rgb(145 167 152 / 16%) !important;
  box-shadow: 0 12px 32px rgb(0 0 0 / 10%);
}

main [class*="rounded-2xl"][class*="border"]:hover {
  border-color: rgb(164 220 69 / 30%) !important;
  box-shadow: 0 16px 38px rgb(0 0 0 / 17%);
  transform: translateY(-2px);
}

input,
select,
textarea {
  min-height: 44px;
  border-color: rgb(145 167 152 / 22%) !important;
  background-color: rgb(9 19 13 / 74%) !important;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--color-indigo-500) !important;
  box-shadow: 0 0 0 3px rgb(164 220 69 / 14%);
}

button:active,
header nav a:active,
aside nav a:active {
  transform: scale(0.97);
}

button[class*="bg-indigo-600"],
a[class*="bg-indigo-600"] {
  box-shadow: 0 7px 18px rgb(133 185 50 / 18%);
}

.overflow-x-auto {
  scrollbar-color: var(--color-zinc-700) transparent;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1023px) {
  html {
    scroll-padding-top: 4.5rem;
  }

  header {
    position: sticky;
    top: 0;
    z-index: 30;
    min-height: 3.75rem;
    padding-top: max(0.55rem, env(safe-area-inset-top)) !important;
    padding-bottom: 0.55rem !important;
    border-color: rgb(145 167 152 / 14%) !important;
    background-color: rgb(11 21 16 / 88%) !important;
    backdrop-filter: blur(18px);
  }

  header nav {
    position: fixed;
    z-index: 40;
    right: 0;
    bottom: 0;
    left: 0;
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0 !important;
    padding: 0.45rem 0.5rem calc(0.45rem + env(safe-area-inset-bottom));
    border-top: 1px solid rgb(145 167 152 / 17%);
    background: rgb(11 21 16 / 94%);
    box-shadow: 0 -12px 32px rgb(0 0 0 / 24%);
    backdrop-filter: blur(20px);
  }

  header nav a {
    display: flex;
    min-height: 3.35rem;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    border-radius: 0.85rem;
    padding: 0.35rem 0.15rem !important;
    color: var(--color-zinc-400);
  }

  header nav a::after {
    content: attr(aria-label);
    font-size: 0.64rem;
    font-weight: 600;
    line-height: 1;
  }

  header nav a.text-indigo-400 {
    background: rgb(164 220 69 / 12%);
    color: var(--color-indigo-400);
  }

  aside.hidden.w-64 {
    display: block !important;
    width: auto;
    flex: none;
    border: 0 !important;
    background: transparent !important;
  }

  aside > div:first-child,
  aside > nav {
    display: none !important;
  }

  aside > div:last-child {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    margin: 0.4rem 0 0;
    border: 1px solid rgb(145 167 152 / 14%) !important;
    border-radius: 1rem;
    padding: 0.65rem !important;
    background: rgb(23 37 29 / 76%);
    box-shadow: 0 8px 24px rgb(0 0 0 / 12%);
  }

  aside > div:last-child > * {
    margin: 0 !important;
  }

  aside > div:last-child > div:first-child {
    width: 100%;
    padding: 0 0.25rem 0.2rem;
  }

  aside > div:last-child > button {
    min-height: 2.75rem;
    flex: 1 1 30%;
    justify-content: center;
    gap: 0.35rem;
    border: 1px solid rgb(145 167 152 / 12%);
    border-radius: 0.7rem;
    padding: 0.45rem 0.3rem !important;
    background: rgb(255 255 255 / 3%);
    color: var(--color-zinc-300);
    font-size: 0.68rem;
    white-space: nowrap;
  }

  main > div {
    padding: 1rem 0.85rem calc(6.75rem + env(safe-area-inset-bottom)) !important;
  }

  main [class*="rounded-2xl"][class*="border"]:hover {
    transform: none;
  }

  table {
    min-width: 36rem;
  }
}

@media (max-width: 380px) {
  header nav a::after {
    font-size: 0.59rem;
  }

  aside > div:last-child > button {
    font-size: 0.62rem;
  }

  main > div {
    padding-inline: 0.7rem !important;
  }
}

@media (max-width: 640px) {
  main > div {
    width: 100%;
    max-width: 100%;
    padding-right: 0.9rem !important;
    padding-left: 0.9rem !important;
  }

  main > div > div:first-child {
    margin-bottom: 1.25rem !important;
  }

  main > div > .mb-8.grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 0.75rem !important;
    margin-bottom: 1.25rem !important;
  }

  main > div > .mb-8.grid > * {
    min-width: 0;
    padding: 1rem !important;
  }

  main > div > .mb-8.grid > :first-child {
    grid-column: 1 / -1;
    min-height: 6.5rem;
    background:
      radial-gradient(ellipse at 100% 0%, rgb(164 220 69 / 14%), transparent 58%),
      linear-gradient(135deg, #1a2e20, #14221b) !important;
  }

  main > div > .grid:not(.mb-8) > a.group {
    padding: 1rem !important;
  }

  main > div > .grid:not(.mb-8) > a.group > div:first-child {
    margin-bottom: 0.75rem;
  }

  main > div > .grid:not(.mb-8) > a.group > p {
    line-height: 1.45;
  }

  main [class*="rounded-2xl"][class*="border"],
  main [class*="rounded-xl"][class*="border"] {
    border-radius: 1.1rem !important;
  }

  main button[class*="bg-indigo-600"] {
    min-height: 2.85rem;
  }

  [role="dialog"] {
    width: 100%;
    max-width: none;
    max-height: min(92dvh, 52rem);
    overflow-y: auto;
    border-radius: 1.4rem 1.4rem 0.9rem 0.9rem;
    padding-bottom: calc(1.25rem + env(safe-area-inset-bottom));
    overscroll-behavior: contain;
  }
}

@media (min-width: 1024px) {
  aside {
    min-height: 100vh;
    box-shadow: 12px 0 36px rgb(0 0 0 / 10%);
  }

  main > div {
    padding-top: clamp(2rem, 4vw, 3.5rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

.password-field {
  position: relative;
}

.password-field input {
  padding-right: 3.25rem !important;
}

.password-visibility-toggle {
  position: absolute;
  top: 1.1rem;
  right: 0.3rem;
  display: inline-flex;
  width: 2.75rem;
  height: 2.75rem;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 0.65rem;
  background: transparent;
  color: var(--color-zinc-400);
  cursor: pointer;
}

.password-visibility-toggle:hover {
  background: rgb(164 220 69 / 10%);
  color: var(--color-indigo-400);
}

.password-visibility-toggle svg {
  width: 1.15rem;
  height: 1.15rem;
}
