:root {
  --green: #2f7d32;
  --green-dark: #215c25;
  --green-soft: #e8f3ed;
  --accent: #f5811e;
  --accent-dark: #d8660a;
  --gold: #f5811e;
  --ink: #222222;
  --muted: #686868;
  --line: #dddddd;
  --paper: #ffffff;
  --page: #f7f7f7;
  --danger: #b3261e;
  color-scheme: light;
  font-family: Arial, Helvetica, sans-serif;
}

* {
  box-sizing: border-box;
}

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

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.login-page {
  display: flex;
  flex-direction: column;
}

.login-shell {
  width: min(100%, 440px);
  flex: 1;
  display: grid;
  place-items: center;
  margin: 0 auto;
  padding: 24px;
}

.login-panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-top: 5px solid var(--accent);
  border-radius: 8px;
  box-shadow: 0 22px 60px rgba(34, 34, 34, 0.1);
  padding: clamp(24px, 6vw, 42px);
}

.brand-logo {
  display: block;
  width: min(240px, 100%);
  height: auto;
  margin: 0 auto 28px;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  font-size: clamp(2rem, 5vw, 3.3rem);
  line-height: 1;
  color: var(--ink);
  margin-bottom: 10px;
}

.login-panel h1 {
  font-size: 2rem;
}

h2 {
  color: var(--ink);
  margin-bottom: 0;
}

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

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

label {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-weight: 700;
  font-size: 0.92rem;
}

input,
select {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  background: #fff;
  color: var(--ink);
}

input:focus,
select:focus {
  outline: 3px solid rgba(205, 163, 73, 0.32);
  border-color: var(--gold);
}

.primary-button,
.ghost-button,
.small-button,
.danger-button,
.icon-button {
  min-height: 42px;
  border-radius: 6px;
  border: 1px solid transparent;
  padding: 10px 14px;
  font-weight: 700;
}

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

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

.ghost-button,
.small-button {
  background: #fff;
  color: var(--ink);
  border-color: var(--line);
}

.danger-button {
  color: #fff;
  background: var(--danger);
}

.icon-button {
  width: 42px;
  padding: 0;
  background: #fff;
  border-color: var(--line);
  font-size: 1.4rem;
}

.message {
  min-height: 1.3em;
  color: var(--danger);
  margin: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px clamp(16px, 4vw, 36px);
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 800;
  letter-spacing: 0;
}

.brand img {
  width: 56px;
  height: auto;
}

.content-shell {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: clamp(18px, 4vw, 34px);
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.page-heading h1 {
  margin-bottom: 6px;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(160px, 240px);
  gap: 14px;
  align-items: end;
  margin-bottom: 16px;
}

.table-wrap {
  overflow-x: auto;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.product-section {
  margin-top: clamp(24px, 5vw, 46px);
}

.section-heading {
  margin-bottom: 14px;
}

.section-heading-actions {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.section-heading h2 {
  font-size: clamp(1.35rem, 3vw, 2rem);
  margin-bottom: 8px;
}

.compact-table {
  min-width: 760px;
}

.glossary {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: clamp(20px, 4vw, 30px);
}

.glossary dl {
  display: grid;
  gap: 16px;
  margin: 0;
}

.glossary dt {
  font-weight: 800;
  margin-bottom: 4px;
}

.glossary dd {
  color: var(--muted);
  line-height: 1.55;
  margin: 0;
}

.site-footer {
  margin-top: clamp(18px, 4vw, 34px);
  border-top: 1px solid var(--line);
  background: var(--paper);
}

.footer-inner {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: clamp(22px, 4vw, 34px);
  text-align: center;
  align-items: start;
  justify-items: center;
}

.footer-section {
  width: min(100%, 320px);
}

.footer-section h2 {
  font-size: 1rem;
  margin-bottom: 10px;
}

.footer-section p {
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 10px;
}

.footer-section a {
  color: var(--green-dark);
  font-weight: 700;
}

.legal-shell {
  width: min(960px, 100%);
  margin: 0 auto;
  padding: clamp(18px, 4vw, 34px);
}

.legal-content {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: clamp(22px, 4vw, 38px);
}

.legal-content h1 {
  font-size: clamp(2rem, 5vw, 3rem);
}

.legal-content h2 {
  margin-top: 28px;
  margin-bottom: 10px;
}

.legal-content h3 {
  margin-top: 20px;
  margin-bottom: 8px;
}

.legal-content p,
.legal-content li {
  color: var(--muted);
  line-height: 1.62;
}

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

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

th {
  background: #fff;
  color: #222;
  font-size: 0.84rem;
  line-height: 1.25;
  user-select: none;
}

th[data-sort] {
  cursor: pointer;
}

tbody tr:nth-child(even) {
  background: #fbfdfc;
}

tbody tr.is-unavailable,
tbody tr.is-unavailable:nth-child(even) {
  background: #f7c8c5;
}

tbody tr.is-unavailable td {
  border-bottom-color: #e9a7a2;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  border-radius: 999px;
  padding: 5px 10px;
  font-weight: 800;
  font-size: 0.82rem;
}

.badge-ja {
  color: var(--green-dark);
  background: var(--green-soft);
}

.badge-knapp {
  color: #684600;
  background: #fff2cc;
}

.badge-nein {
  color: var(--danger);
  background: #fde8e7;
}

.actions {
  display: flex;
  gap: 8px;
  min-width: 190px;
}

dialog {
  width: min(720px, calc(100% - 28px));
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0;
  box-shadow: 0 24px 80px rgba(34, 34, 34, 0.22);
}

dialog::backdrop {
  background: rgba(34, 34, 34, 0.38);
}

dialog form {
  padding: 22px;
}

.dialog-head,
.dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.dialog-head {
  margin-bottom: 20px;
}

.dialog-actions {
  margin-top: 20px;
}

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

@media (max-width: 760px) {
  .topbar {
    align-items: flex-start;
  }

  .brand span {
    font-size: 0.94rem;
  }

  .brand img {
    width: 46px;
  }

  .page-heading,
  .toolbar {
    grid-template-columns: 1fr;
  }

  .page-heading {
    display: grid;
    align-items: stretch;
  }

  .section-heading-actions {
    display: grid;
    align-items: stretch;
  }

  .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .actions {
    min-width: 190px;
  }

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

  .footer-inner {
    grid-template-columns: 1fr;
  }
}
