:root {
  --bg: #0f1724;
  --bg-soft: rgba(17, 24, 39, 0.72);
  --panel: rgba(12, 18, 29, 0.88);
  --line: rgba(165, 180, 252, 0.18);
  --line-strong: rgba(253, 186, 116, 0.28);
  --text: #edf4ff;
  --muted: #aac0dc;
  --accent: #f59e0b;
  --accent-soft: #fcd34d;
  --danger: #fca5a5;
  --success: #86efac;
  --shadow: 0 28px 60px rgba(2, 6, 23, 0.36);
  --font-body: "Segoe UI Variable", "Aptos", "Trebuchet MS", sans-serif;
  --font-display: "Georgia", "Palatino Linotype", serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(245, 158, 11, 0.18), transparent 32%),
    radial-gradient(circle at bottom right, rgba(14, 165, 233, 0.18), transparent 28%),
    linear-gradient(135deg, #0a0f18 0%, #101827 52%, #172033 100%);
  font-family: var(--font-body);
}

body {
  min-height: 100vh;
}

button,
input,
textarea,
select {
  font: inherit;
}

.page-shell {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
}

.glow {
  position: absolute;
  border-radius: 999px;
  filter: blur(60px);
  opacity: 0.7;
  pointer-events: none;
}

.glow-a {
  top: 70px;
  left: -60px;
  width: 240px;
  height: 240px;
  background: rgba(56, 189, 248, 0.24);
}

.glow-b {
  right: -50px;
  bottom: 120px;
  width: 280px;
  height: 280px;
  background: rgba(249, 115, 22, 0.2);
}

.app-frame {
  position: relative;
  z-index: 1;
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 48px;
}

.panel {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  border-radius: 24px;
}

.auth-panel {
  width: min(540px, 100%);
  margin: 10vh auto 0;
  padding: 28px;
  animation: rise-in 0.6s ease both;
  display: grid;
  justify-items: stretch;
  background: rgba(8, 13, 22, 0.9);
  border-color: rgba(203, 213, 225, 0.22);
}

.auth-panel > * {
  width: 100%;
}

.auth-header {
  display: grid;
  justify-items: center;
  gap: 10px;
  margin-bottom: 16px;
  text-align: center;
}

.auth-logo {
  width: min(150px, 42%);
  height: auto;
  display: block;
  margin: 0;
  object-fit: contain;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--font-display);
  letter-spacing: 0.02em;
}

h1 {
  margin-top: 8px;
  font-size: clamp(2.3rem, 4vw, 3.5rem);
}

.auth-panel h1 {
  margin-top: 0;
  font-size: clamp(2rem, 5.2vw, 2.95rem);
  line-height: 0.98;
  text-wrap: balance;
  overflow-wrap: normal;
  word-break: normal;
  max-width: 11ch;
}

h2 {
  font-size: 1.6rem;
}

h3 {
  font-size: 1.15rem;
}

.eyebrow {
  color: var(--accent-soft);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.72rem;
  font-weight: 700;
}

.intro {
  color: var(--muted);
  margin: 0 0 28px;
  line-height: 1.6;
  text-align: left;
}

.stack-form,
.stack-form label {
  display: grid;
  gap: 10px;
}

.stack-form {
  gap: 18px;
}

.auth-panel .stack-form {
  text-align: left;
}

input,
textarea,
select {
  width: 100%;
  border-radius: 14px;
  border: 1px solid rgba(203, 213, 225, 0.16);
  background: rgba(15, 23, 36, 0.84);
  color: var(--text);
  padding: 12px 14px;
  outline: none;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(251, 191, 36, 0.75);
  transform: translateY(-1px);
}

textarea {
  resize: vertical;
}

.primary-button,
.ghost-button {
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  cursor: pointer;
  transition: transform 0.18s ease, opacity 0.18s ease, background 0.18s ease;
}

.primary-button {
  color: #1f2937;
  background: linear-gradient(135deg, #f59e0b, #fcd34d);
  font-weight: 800;
}

.ghost-button {
  color: var(--text);
  background: rgba(148, 163, 184, 0.12);
  border: 1px solid rgba(148, 163, 184, 0.18);
}

.primary-button:hover,
.ghost-button:hover {
  transform: translateY(-1px);
}

.error-text {
  margin-top: 18px;
  color: var(--danger);
}

.app-layout {
  display: grid;
  gap: 22px;
}

.topbar {
  padding: 24px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  animation: rise-in 0.45s ease both;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.user-badge {
  padding: 11px 16px;
  border-radius: 999px;
  background: rgba(249, 115, 22, 0.12);
  border: 1px solid var(--line-strong);
  color: #ffedd5;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
}

.stat-card {
  padding: 18px 20px;
  display: grid;
  gap: 8px;
  animation: rise-in 0.5s ease both;
}

.stat-card strong {
  font-size: 2rem;
}

.stat-label {
  color: var(--muted);
  font-size: 0.92rem;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 22px;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(240px, 280px) minmax(0, 1fr);
  gap: 22px;
}

.side-nav,
.section-panel {
  padding: 24px;
}

.side-nav {
  align-self: start;
  position: sticky;
  top: 24px;
}

.section-copy {
  color: var(--muted);
  line-height: 1.6;
  margin: 12px 0 18px;
}

.nav-stack {
  display: grid;
  gap: 10px;
}

.nav-button {
  width: 100%;
  text-align: left;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  padding: 14px 16px;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.nav-button:hover,
.nav-button.is-active {
  transform: translateY(-1px);
  border-color: rgba(251, 191, 36, 0.35);
  background: rgba(245, 158, 11, 0.12);
}

.panel-stack {
  display: grid;
  gap: 22px;
}

.column,
.column > section {
  min-width: 0;
}

.panel section,
.panel .section-head {
  min-width: 0;
}

.content-grid > .column > .panel,
#user-management {
  padding: 24px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
  margin-bottom: 18px;
}

.filter-row {
  display: flex;
  gap: 10px;
  width: min(100%, 620px);
}

.filter-row > *:first-child {
  flex: 1 1 420px;
}

.editor-card {
  padding: 18px;
  margin-bottom: 18px;
  border-radius: 18px;
  border: 1px solid rgba(245, 158, 11, 0.14);
  background: rgba(20, 28, 44, 0.55);
}

.setup-card {
  max-width: 560px;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.button-row {
  display: flex;
  gap: 10px;
}

.action-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.result-list {
  display: grid;
  gap: 14px;
}

.result-card {
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(7, 12, 20, 0.62);
  border: 1px solid rgba(148, 163, 184, 0.14);
  display: grid;
  gap: 10px;
}

.result-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 16px;
}

.result-head h3 {
  font-size: 1.12rem;
}

.result-meta,
.result-notes {
  color: var(--muted);
  line-height: 1.55;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(96, 165, 250, 0.18);
  color: #dbeafe;
  font-size: 0.88rem;
}

.tag.status-frei {
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(74, 222, 128, 0.22);
  color: #dcfce7;
}

.tag.status-vergeben {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(251, 191, 36, 0.25);
  color: #fef3c7;
}

.tag.status-entsorgt {
  background: rgba(248, 113, 113, 0.14);
  border-color: rgba(248, 113, 113, 0.3);
  color: #fecaca;
}

.small-button {
  justify-self: start;
  padding: 9px 14px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text);
  cursor: pointer;
}

.danger-button {
  border-color: rgba(248, 113, 113, 0.28);
  background: rgba(239, 68, 68, 0.12);
  color: #fecaca;
}

.search-stack {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 18px;
}

.checkbox-grid {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.check-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}

.check-row input {
  width: auto;
  margin: 0;
}

.compact-list {
  max-height: 430px;
  overflow: auto;
  padding-right: 4px;
}

.user-card-form {
  display: grid;
  gap: 12px;
}

.inline-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.info-strip {
  padding: 14px 18px;
  border-radius: 18px;
  border: 1px solid rgba(251, 191, 36, 0.25);
  background: rgba(245, 158, 11, 0.12);
}

.empty-state {
  padding: 20px;
  border-radius: 18px;
  border: 1px dashed rgba(148, 163, 184, 0.25);
  color: var(--muted);
  text-align: center;
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1100px) {
  .stats-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .content-grid,
  .admin-grid,
  .workspace-grid {
    grid-template-columns: 1fr;
  }

  .side-nav {
    position: static;
  }
}

@media (max-width: 760px) {
  .app-frame {
    width: min(100% - 20px, 1280px);
    padding-top: 20px;
  }

  .auth-panel,
  .topbar,
  .content-grid > .column > .panel,
  #user-management {
    padding: 20px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .topbar,
  .section-head,
  .filter-row,
  .button-row,
  .result-head {
    flex-direction: column;
    align-items: stretch;
  }

  .field-grid,
  .inline-grid {
    grid-template-columns: 1fr;
  }
}
