:root {
  color-scheme: dark;
  --bg: #100d0f;
  --bg-soft: #1a1418;
  --panel: #1f171c;
  --line: #3a2a33;
  --text: #f3edf0;
  --muted: #c9bdc4;
  --accent: #7f1d2d;
  --accent-hover: #97243a;
  --danger: #aa3b3b;
  --danger-hover: #bf4545;
  --error: #f08e9d;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Iosevka", "JetBrains Mono", "DejaVu Sans Mono", monospace;
  background: radial-gradient(circle at 20% 0%, #23161c 0%, var(--bg) 40%), var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.page-bg {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: -1;
}

.orb {
  position: absolute;
  border-radius: 999px;
  filter: blur(48px);
  opacity: 0.22;
  animation: drift 16s ease-in-out infinite alternate;
}

.orb-a {
  width: 240px;
  height: 240px;
  background: #8f1f35;
  top: 8%;
  left: -60px;
}

.orb-b {
  width: 300px;
  height: 300px;
  background: #4b1726;
  right: -100px;
  bottom: 5%;
  animation-delay: 1.5s;
}

@keyframes drift {
  from {
    transform: translateY(0) translateX(0);
  }

  to {
    transform: translateY(25px) translateX(20px);
  }
}

header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel) 80%, black);
  backdrop-filter: blur(2px);
}

.brand h1 {
  margin: 0;
}

.brand .sub {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

main {
  max-width: 1040px;
  margin: 1.5rem auto;
  padding: 0 1rem;
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.75rem;
  color: var(--muted);
}

.breadcrumbs .sep {
  color: #9a848f;
}

.top-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.icon {
  display: inline-flex;
  width: 1rem;
  justify-content: center;
  align-items: center;
  line-height: 1;
}

section {
  background: linear-gradient(180deg, rgba(40, 26, 34, 0.7), rgba(25, 19, 23, 0.94));
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  padding: 1rem;
  margin-bottom: 1rem;
}

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

.section-header h2,
.section-header h3 {
  margin: 0;
}

.section-subtitle {
  margin: 0.35rem 0 0;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  text-align: left;
  border-bottom: 1px solid var(--line);
  padding: 0.5rem;
}

label {
  display: block;
  margin-top: 0.5rem;
  margin-bottom: 0.3rem;
  font-weight: 600;
}

input,
button {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 0.35rem;
  padding: 0.55rem;
  font: inherit;
  background: #181116;
  color: var(--text);
}

button {
  margin-top: 0.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  cursor: pointer;
  color: #fff;
  background: var(--accent);
  border: none;
}

button:hover {
  background: var(--accent-hover);
}

button.danger-button,
.button-link.danger-button {
  background: var(--danger);
}

button.danger-button:hover,
.button-link.danger-button:hover {
  background: var(--danger-hover);
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-width: 110px;
  padding: 0.55rem 0.75rem;
  border-radius: 0.35rem;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  border: 1px solid transparent;
}

.button-link:hover {
  background: var(--accent-hover);
  color: #fff;
}

.inline-form {
  display: inline-flex;
  margin: 0;
}

.inline-form button {
  margin-top: 0;
  width: auto;
  min-width: 110px;
}

.row-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.header-logout {
  min-width: 0;
  padding: 0.45rem 0.7rem;
}

a {
  color: #d17b91;
}

a:hover {
  color: #ec9fb0;
}

code {
  color: #f4b2c0;
}

.error {
  color: var(--error);
  font-weight: 600;
}

.auth {
  max-width: 480px;
  margin: 8vh auto 0;
}

p,
td,
label,
input {
  color: var(--muted);
}

h1,
h2,
h3,
th,
strong {
  color: var(--text);
}

@media (max-width: 700px) {
  .top-actions {
    width: 100%;
    justify-content: flex-start;
    align-items: stretch;
  }

  .top-actions .inline-form {
    width: 100%;
  }

  .top-actions .button-link,
  .top-actions button {
    width: 100%;
  }

  .row-actions {
    width: 100%;
  }

  .row-actions .button-link,
  .row-actions button {
    width: auto;
  }

  .section-header {
    align-items: stretch;
  }

  .section-header .button-link {
    width: 100%;
  }
}
