/**
 * TuroCraft Plattform – Gestaltung im Stil der neuen Velunaria-Seiten (Papier, Tinte, Grün; Archivo, IBM Plex Mono, DM Serif
 * Display aus /fonts, eingebunden über /css/fonts.css – beide liefert der vHost aus dem Webroot von Velunaria), neutral gehalten. Für Laptop und Tablet: Seitenleiste ab 900 px, darunter
 * aufklappbar. Große, klare Bedienelemente (mindestens 44 px hoch).
 */
:root {
  --paper: #f4f1ea;
  --paper-bright: #faf8f3;
  --card: #ffffff;
  --ink: #1a1a2e;
  --muted: #5c5a55;
  --rule: #d2ccbe;
  --rule-strong: #8f8872;
  --green: #1a6b4a;
  --green-deep: #135339;
  --green-soft: #e3efe8;
  --error: #a1262e;
  --error-soft: #f6e3e4;
  --warn: #8a5a00;
  --warn-soft: #f8ecd2;
  --info-soft: #e6ebf3;
  --font-sans: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --font-wordmark: "DM Serif Display", Georgia, serif;
  --radius: 10px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--green-deep); text-underline-offset: 0.2em; }
a:hover { color: var(--green); }
:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }

h1, h2, h3 { line-height: 1.25; margin: 0 0 0.75rem; }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 0.75rem; }

.mono { font-family: var(--font-mono); font-size: 0.92em; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.pre-line { white-space: pre-line; }

/* ---------------------------------------------------------------- Wortmarke */
.brand { display: inline-flex; align-items: baseline; gap: 0.4rem; text-decoration: none; color: var(--ink); }
.brand__word { font-family: var(--font-wordmark); font-size: 1.45rem; letter-spacing: 0.01em; }
.brand__tag { font-family: var(--font-mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); }

/* ---------------------------------------------------------------- Anmeldung und Einladung */
.auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 2rem 1rem; }
.auth { width: 100%; max-width: 440px; }
.auth .brand { margin-bottom: 1.25rem; }
.auth-card { background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); padding: 2rem 1.75rem; }
.auth-card h1 { font-size: 1.5rem; }
.auth-kicker { font-family: var(--font-mono); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); margin-bottom: 0.4rem; }
.auth-foot { margin-top: 1rem; font-size: 0.9rem; color: var(--muted); }

/* ---------------------------------------------------------------- Formulare und Knöpfe */
.field { margin-bottom: 1rem; }
.field label { display: block; font-weight: 600; margin-bottom: 0.3rem; }
.field .hint { font-size: 0.88rem; color: var(--muted); margin-top: 0.25rem; }
input[type="text"], input[type="email"], input[type="password"], input[type="date"], input[type="search"], select, textarea {
  width: 100%;
  min-height: 46px;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--rule-strong);
  border-radius: 8px;
  background: var(--paper-bright);
  color: var(--ink);
  font: inherit;
}
input:focus, select:focus, textarea:focus { border-color: var(--green); outline: 2px solid var(--green-soft); }
.code-input { font-family: var(--font-mono); font-size: 1.4rem; letter-spacing: 0.25em; text-align: center; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  min-height: 46px; padding: 0.6rem 1.15rem;
  border: 1px solid var(--green-deep); border-radius: 8px;
  background: var(--green); color: #fff;
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
}
.btn:hover { background: var(--green-deep); color: #fff; }
.btn--block { width: 100%; }
.btn--quiet { background: var(--card); color: var(--ink); border-color: var(--rule-strong); }
.btn--quiet:hover { background: var(--paper-bright); color: var(--ink); }
.btn--danger { background: var(--error); border-color: #7d1c23; }
.btn--danger:hover { background: #7d1c23; }
.btn[disabled], .btn[aria-disabled="true"] { background: #c9c4b8; border-color: #b5af9f; color: #5c5a55; cursor: not-allowed; }
.btn--small { min-height: 44px; padding: 0.35rem 0.8rem; font-size: 0.92rem; }

.inline-form { display: inline; margin: 0; }
.row { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: flex-end; }
.row > .field { flex: 1 1 200px; margin-bottom: 0; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 1rem; }

/* ---------------------------------------------------------------- Meldungen */
.flash { border-radius: 8px; padding: 0.75rem 1rem; margin-bottom: 1rem; border: 1px solid transparent; }
.flash--success { background: var(--green-soft); border-color: #9cc6b1; }
.flash--error { background: var(--error-soft); border-color: #d9a3a7; color: #6e1a20; }
.flash--info { background: var(--info-soft); border-color: #b3bfd3; }
.note { background: var(--warn-soft); border: 1px solid #e3c98f; border-radius: 8px; padding: 0.7rem 0.9rem; margin: 0.5rem 0 1rem; }

/* ---------------------------------------------------------------- Rahmen mit Seitenleiste */
.shell { display: grid; grid-template-columns: 270px 1fr; min-height: 100vh; background: linear-gradient(to right, var(--ink) 0 270px, var(--paper) 270px); }
.side { background: var(--ink); color: #efece4; padding: 1.25rem 1rem; display: flex; flex-direction: column; gap: 1rem; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side .brand { color: #fff; }
.side .brand__tag { color: #b9b5aa; }
.side nav { display: flex; flex-direction: column; gap: 0.15rem; }
.side__group { margin-top: 0.75rem; font-family: var(--font-mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.12em; color: #b9b5aa; padding: 0 0.6rem 0.25rem; }
.side a.nav { display: flex; align-items: center; justify-content: space-between; min-height: 44px; padding: 0.45rem 0.6rem; border-radius: 8px; color: #efece4; text-decoration: none; }
.side a.nav:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.side a.nav[aria-current="page"] { background: rgba(255, 255, 255, 0.14); color: #fff; font-weight: 600; }
.side .count { min-width: 1.6rem; padding: 0 0.4rem; border-radius: 999px; background: #c9e4d6; color: var(--ink); font-size: 0.82rem; font-weight: 700; text-align: center; }
.side .ext { font-size: 0.85rem; color: #b9b5aa; }
.side__foot { margin-top: auto; border-top: 1px solid rgba(255, 255, 255, 0.15); padding-top: 0.9rem; font-size: 0.92rem; }
.side__foot .btn { width: 100%; margin-top: 0.5rem; }
.main { padding: 1.75rem 2rem 3rem; min-width: 0; }
.main__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.75rem; margin-bottom: 1.25rem; }
.main__head h1 { margin: 0; }
.menu-toggle { display: none; }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; grid-template-rows: auto 1fr; background: var(--paper); }
  .side { position: static; height: auto; padding: 0.75rem 1rem; }
  .side__top { display: flex; justify-content: space-between; align-items: center; }
  .menu-toggle { display: inline-flex; }
  .side nav, .side__foot { display: none; }
  .side.open nav, .side.open .side__foot { display: flex; flex-direction: column; }
  .main { padding: 1.25rem 1rem 2.5rem; }
}

/* ---------------------------------------------------------------- Karten, Kacheln, Tabellen */
.card { background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); padding: 1.25rem 1.25rem 1rem; margin-bottom: 1.25rem; }
.card > h2 { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; }
.product { margin-bottom: 2rem; }
.product__head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: 0.75rem; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1rem; }
.tile { background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); padding: 1rem 1.1rem; color: var(--ink); text-decoration: none; display: block; }
a.tile:hover { border-color: var(--green); color: var(--ink); }
.tile__title { font-weight: 700; margin-bottom: 0.5rem; }
.tile dl { margin: 0; display: grid; grid-template-columns: 1fr auto; gap: 0.2rem 0.75rem; }
.tile dt { color: var(--muted); }
.tile dd { margin: 0; font-family: var(--font-mono); font-weight: 500; text-align: right; }
.tile--link { display: flex; flex-direction: column; justify-content: space-between; gap: 0.75rem; }

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--card); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 0.6rem 0.75rem; border-bottom: 1px solid #ebe6da; vertical-align: top; }
th { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); background: var(--paper-bright); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-family: var(--font-mono); }
th.num { font-family: inherit; }
td.mono { white-space: nowrap; }
/* Auf dem Tablet nur die Spalten, die man zum Handeln braucht; die übrigen stehen in der Einzelansicht. */
@media (max-width: 1200px) { th.opt, td.opt { display: none; } }
.table-wrap + p { margin-top: 0.6rem; }
.choice { display: flex; align-items: center; gap: 0.6rem; min-height: 44px; font-weight: 500; cursor: pointer; }
.choice input { width: 22px; height: 22px; margin: 0; accent-color: var(--green); }
tbody tr:hover { background: #fbfaf6; }

.badge { display: inline-block; padding: 0.1rem 0.55rem; border-radius: 999px; font-size: 0.82rem; font-weight: 600; border: 1px solid var(--rule-strong); background: var(--paper-bright); white-space: nowrap; }
.badge--green { background: var(--green-soft); border-color: #9cc6b1; color: var(--green-deep); }
.badge--red { background: var(--error-soft); border-color: #d9a3a7; color: #6e1a20; }
.badge--warn { background: var(--warn-soft); border-color: #e3c98f; color: var(--warn); }

dl.facts { display: grid; grid-template-columns: minmax(140px, max-content) 1fr; gap: 0.35rem 1rem; margin: 0 0 0.75rem; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; }

.search { display: flex; gap: 0.5rem; margin-bottom: 1rem; flex-wrap: wrap; }
.search input { flex: 1 1 260px; }

.tabs { display: flex; gap: 0.5rem; margin-bottom: 1rem; flex-wrap: wrap; }
.tabs a { min-height: 40px; display: inline-flex; align-items: center; padding: 0.35rem 0.9rem; border-radius: 999px; border: 1px solid var(--rule-strong); text-decoration: none; color: var(--ink); background: var(--card); }
.tabs a[aria-current="page"] { background: var(--ink); color: #fff; border-color: var(--ink); }

.danger-zone { border-top: 1px dashed var(--rule-strong); margin-top: 0.75rem; padding-top: 0.75rem; }
.confirm { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: flex-end; }
.confirm .field { flex: 1 1 220px; margin: 0; }
/* Bestätigung per Haken (Anfrage als Spam löschen): große Fläche zum Antippen, in einer Zeile mit dem Knopf */
.confirm .check { display: inline-flex; align-items: center; gap: 0.5rem; min-height: 44px; padding: 0 0.25rem; cursor: pointer; }
.confirm .check input { width: 22px; height: 22px; margin: 0; flex: none; }
.confirm--check { align-items: center; }

.codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.4rem 1rem; font-family: var(--font-mono); font-size: 1.1rem; margin: 1rem 0; padding: 1rem; background: var(--paper-bright); border: 1px solid var(--rule); border-radius: 8px; }
.qr { display: flex; justify-content: center; margin: 1rem 0; min-height: 200px; }
.qr canvas, .qr img { width: 200px; height: 200px; image-rendering: pixelated; }
.secret { font-family: var(--font-mono); word-break: normal; overflow-wrap: break-word; word-spacing: 0.2em; background: var(--paper-bright); border: 1px solid var(--rule); border-radius: 8px; padding: 0.5rem 0.75rem; }
.log td { font-size: 0.92rem; }
.preview dt { font-weight: 600; color: var(--ink); }
