:root {
  color-scheme: dark;
  --bg: #030407;
  --bg-soft: #07090d;
  --panel: rgba(11, 14, 20, 0.9);
  --panel-solid: #0e121a;
  --panel-strong: rgba(12, 16, 24, 0.98);
  --line: rgba(190, 205, 225, 0.13);
  --line-strong: rgba(190, 205, 225, 0.23);
  --text: #f6f8fb;
  --muted: #9ca8b8;
  --muted-2: #718092;
  --blue: #1d4ed8;
  --cyan: #38bdf8;
  --green: #22c55e;
  --amber: #f59e0b;
  --red: #ef4444;
  --violet: #8b5cf6;
  --radius: 8px;
  --shadow: 0 30px 110px rgba(0, 0, 0, 0.58);
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-family: var(--font);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent 22%),
    radial-gradient(circle at 15% -8%, rgba(29, 78, 216, 0.28), transparent 30%),
    radial-gradient(circle at 88% 4%, rgba(56, 189, 248, 0.12), transparent 26%),
    linear-gradient(135deg, #030407 0%, #070a0f 52%, #0a0d13 100%);
  background-attachment: fixed;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.38;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: linear-gradient(to bottom, black, transparent 76%);
}

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

button {
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.shell {
  width: min(1260px, 100%);
  margin: 0 auto;
  padding: 18px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: -18px -18px 18px;
  padding: 16px 18px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(3, 4, 7, 0.86);
  backdrop-filter: blur(20px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(56, 189, 248, 0.5);
  border-radius: 50%;
  background:
    linear-gradient(145deg, rgba(29, 78, 216, 0.98), rgba(7, 10, 15, 0.95)),
    #0b1220;
  box-shadow: 0 0 0 7px rgba(29, 78, 216, 0.09), 0 0 42px rgba(59, 130, 246, 0.28);
  color: #ffffff;
  font-weight: 900;
  letter-spacing: 0;
}

.brand strong {
  display: block;
  font-size: 15px;
}

.brand small,
td small {
  display: block;
  color: var(--muted);
  margin-top: 2px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-chip {
  display: inline-flex;
  align-items: center;
  max-width: 280px;
  overflow: hidden;
  color: var(--muted);
  white-space: nowrap;
  text-overflow: ellipsis;
}

.login-screen {
  min-height: calc(100vh - 36px);
  display: grid;
  place-items: center;
}

.login-card,
.panel {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.065), rgba(255, 255, 255, 0.018)),
    var(--panel);
  box-shadow: var(--shadow);
}

.login-card::before,
.hero-panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 2px;
  background: linear-gradient(90deg, var(--blue), var(--cyan), transparent);
}

.login-card {
  width: min(760px, 100%);
  min-height: 430px;
  display: grid;
  align-content: center;
  padding: 42px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.065), rgba(255, 255, 255, 0.02)),
    radial-gradient(circle at 92% 24%, rgba(56, 189, 248, 0.2), transparent 25%),
    radial-gradient(circle at 84% 74%, rgba(29, 78, 216, 0.22), transparent 30%),
    var(--panel-solid);
}

.login-card::after {
  content: "HN";
  position: absolute;
  right: 34px;
  bottom: 26px;
  color: rgba(255, 255, 255, 0.035);
  font-size: clamp(90px, 20vw, 170px);
  font-weight: 950;
  line-height: 1;
  letter-spacing: -0.04em;
}

.hero-badge {
  display: inline-grid;
  place-items: center;
  width: max-content;
  margin-bottom: 18px;
  padding: 7px 11px;
  border: 1px solid rgba(34, 211, 238, 0.36);
  border-radius: 7px;
  color: #dbeafe;
  background: rgba(29, 78, 216, 0.16);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  line-height: 1.06;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(32px, 6vw, 56px);
}

h2 {
  font-size: 20px;
  margin-bottom: 16px;
}

p {
  color: var(--muted);
  line-height: 1.6;
}

.grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  gap: 18px;
  align-items: start;
}

.admin-grid {
  grid-template-columns: minmax(300px, 0.86fr) minmax(0, 1.14fr);
}

.panel {
  padding: 24px;
}

.wide {
  grid-column: 1 / -1;
}

.hero-panel {
  min-height: 250px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background:
    radial-gradient(circle at 18% 0%, rgba(29, 78, 216, 0.38), transparent 40%),
    radial-gradient(circle at 100% 20%, rgba(56, 189, 248, 0.16), transparent 42%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.025)),
    var(--panel-strong);
}

.eyebrow {
  margin: 0 0 10px;
  color: #a5f3fc;
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.1em;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 22px;
}

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

.stats div {
  min-height: 88px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.018)),
    rgba(255, 255, 255, 0.025);
}

.stats strong {
  display: block;
  font-size: 27px;
  line-height: 1;
}

.stats span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.form {
  display: grid;
  gap: 13px;
}

.compact {
  gap: 10px;
}

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 13px;
  color: var(--text);
  background: rgba(3, 5, 10, 0.9);
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

select {
  cursor: pointer;
}

textarea {
  resize: vertical;
  min-height: 96px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(34, 211, 238, 0.85);
  box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.13);
  background: rgba(5, 11, 21, 0.96);
}

.primary,
.secondary,
.ghost,
.mini {
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 900;
  transition: transform 130ms ease, filter 130ms ease, border-color 130ms ease, background 130ms ease;
}

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

.primary {
  padding: 13px 16px;
  color: white;
  background: linear-gradient(135deg, #1d4ed8, #0369a1);
  box-shadow: 0 18px 42px rgba(29, 78, 216, 0.28);
}

.secondary {
  display: inline-grid;
  place-items: center;
  padding: 12px 16px;
  border: 1px solid var(--line);
  color: var(--text);
  background: rgba(255, 255, 255, 0.055);
}

.ghost {
  padding: 9px 12px;
  color: #dbeafe;
  background: rgba(255, 255, 255, 0.06);
}

.mini {
  padding: 7px 9px;
  color: white;
  background: rgba(37, 99, 235, 0.78);
}

.mini.danger {
  background: rgba(239, 68, 68, 0.18);
  color: #fecaca;
}

.mini.warning {
  background: rgba(245, 158, 11, 0.18);
  color: #fde68a;
}

.mini.neutral {
  background: rgba(148, 163, 184, 0.18);
  color: #dbe7f5;
}

.link-button {
  display: inline-grid;
  place-items: center;
}

.alert {
  margin: 12px 0;
  padding: 12px;
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: 8px;
  color: #fecaca;
  background: rgba(239, 68, 68, 0.12);
}

.test-logins {
  display: grid;
  gap: 5px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

code {
  color: #a5f3fc;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.16);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 780px;
}

th,
td {
  padding: 14px 13px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: #b8c4d5;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: rgba(255, 255, 255, 0.045);
}

tr:last-child td {
  border-bottom: 0;
}

tbody tr {
  transition: background 130ms ease;
}

tbody tr:hover {
  background: rgba(255, 255, 255, 0.035);
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 9px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.status::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: currentColor;
}

.status.offen,
.status.eingereicht {
  border-color: rgba(245, 158, 11, 0.28);
  color: #fde68a;
  background: rgba(245, 158, 11, 0.13);
}

.status.freigegeben {
  border-color: rgba(34, 197, 94, 0.28);
  color: #bbf7d0;
  background: rgba(34, 197, 94, 0.13);
}

.status.abgelehnt {
  border-color: rgba(239, 68, 68, 0.28);
  color: #fecaca;
  background: rgba(239, 68, 68, 0.13);
}

.status.abgerechnet {
  border-color: rgba(59, 130, 246, 0.28);
  color: #bfdbfe;
  background: rgba(59, 130, 246, 0.13);
}

.row-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.muted {
  color: var(--muted);
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.section-head h2 {
  margin-bottom: 0;
}

.pager {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
}

.pager .secondary:last-child {
  justify-self: end;
}

.audit-list {
  display: grid;
  gap: 8px;
}

.audit-list div {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.audit-list span,
.audit-list small {
  display: block;
  color: var(--muted);
  margin-top: 3px;
}

@media (max-width: 900px) {
  .grid,
  .admin-grid {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 760px) {
  .shell {
    padding: 12px;
  }

  .topbar {
    margin: -12px -12px 14px;
    padding: 12px;
  }

  .split {
    grid-template-columns: 1fr;
  }

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

  .section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .panel {
    padding: 16px;
  }

  .login-card {
    padding: 22px;
  }

  .user-chip {
    display: none;
  }

  h1 {
    font-size: 34px;
  }
}
