/* TREVALON TMS · Corporate Design laut Brandbook v1.0 (Farben, Schriften, Karten, Schaltflächen) */
@font-face { font-family: "Sora"; src: url("/assets/fonts/Sora-VF.ttf") format("truetype"); font-weight: 100 800; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/assets/fonts/Inter-VF.ttf") format("truetype"); font-weight: 100 900; font-display: swap; }

:root {
  --ink: #0E1116;
  --ink-2: #2A2D33;
  --champ: #C9A86E;      /* Akzent auf dunklem Grund */
  --brass: #A07E46;      /* Akzent auf hellem Grund */
  --stone: #6B6660;
  --stone-light: #A8A29A;
  --ivory: #F6F3EC;
  --ivory-2: #EFEADF;
  --panel: #FCFAF6;
  --white: #FFFFFF;
  --brass-soft: rgba(160, 126, 70, .12);
  --line: rgba(14, 17, 22, .1);
  --line-2: rgba(14, 17, 22, .18);
  --shadow: 0 1px 2px rgba(14, 17, 22, .04), 0 12px 40px -12px rgba(14, 17, 22, .14);
  --radius: 14px;
  --radius-sm: 9px;
  --ok: #2E6B3F;
  --warn: #8A5A00;
  --err: #A12A2A;
  --font-head: "Sora", "Inter", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--ivory);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; line-height: 1.6; font-size: 16px; background: var(--ivory); }
h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 300; line-height: 1.12; letter-spacing: -.02em; margin: 0 0 .6em; color: var(--ink); }
h1 { font-size: clamp(1.7rem, 2.6vw, 2.3rem); letter-spacing: -.035em; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.08rem; font-weight: 400; letter-spacing: -.01em; }
h4 { font-size: .95rem; font-weight: 500; letter-spacing: 0; }
p { margin: 0 0 .8em; }
a { color: var(--brass); text-underline-offset: 3px; }
.gold { color: var(--brass); }
:focus-visible { outline: 2px solid var(--brass); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--stone); }
.small { font-size: .86rem; }
.lead { color: var(--stone); font-size: 1.05rem; max-width: 70ch; }

/* Abschnittsmarke: Stern in Messing, Name, Nummer, Thema */
.kicker { display: flex; align-items: center; gap: .5rem; font: 500 .72rem/1 var(--font-body); letter-spacing: .18em; text-transform: uppercase; color: var(--stone); margin: 0 0 .9rem; }
.kicker b { color: var(--ink); font-weight: 600; }
.kicker svg { width: 13px; height: 13px; color: var(--brass); flex: none; }

/* ---------- Kopfzeile (helle Seiten) ---------- */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 1.2rem; padding: .8rem clamp(1rem, 3vw, 2rem); background: rgba(246, 243, 236, .92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.logo { display: inline-flex; align-items: center; }
.logo img { height: 18px; width: auto; display: block; }
.logo .full { display: block; } .logo .short { display: none; }
@media (max-width: 560px) {
  .logo .full { display: none; } .logo .short { display: block; }
  .topbar { flex-wrap: nowrap; gap: .9rem; }
  .topbar .who { display: none; }
  .topbar a, .topbar button.link { font-size: .88rem; }
}
.topbar nav { display: flex; gap: 1.2rem; flex-wrap: wrap; }
.topbar nav a, .topbar .navlink { color: var(--ink); text-decoration: none; font-size: .93rem; }
.topbar nav a:hover, .topbar .navlink:hover { color: var(--brass); }
.topbar .spacer { flex: 1; }
.topbar .who { color: var(--stone); font-size: .88rem; }

main { max-width: 1120px; margin: 0 auto; padding: clamp(1.2rem, 3vw, 2.2rem) clamp(1rem, 3vw, 2rem) 4rem; }
main.narrow { max-width: 480px; }

/* ---------- Karten ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(1rem, 2.4vw, 1.6rem); margin-bottom: 1.1rem; box-shadow: var(--shadow); }
.card.flat { box-shadow: none; }
.card-glow { position: relative; overflow: hidden; }
.card-glow::before { content: ""; position: absolute; inset: -40% -20% auto auto; width: 60%; height: 140%; background: radial-gradient(closest-side, rgba(201, 168, 110, .14), transparent); pointer-events: none; }

/* ---------- Formulare ---------- */
label { display: block; font-weight: 500; font-size: .92rem; margin: 1rem 0 .3rem; }
.help { font-size: .86rem; color: var(--stone); margin: 0 0 .35rem; }
input[type=text], input[type=password], input[type=email], input[type=date], input[type=search], input:not([type]), select, textarea {
  width: 100%; padding: .7rem .85rem; font: inherit; font-size: .96rem; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--white); color: var(--ink);
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brass); box-shadow: 0 0 0 3px var(--brass-soft); }
textarea { min-height: 9rem; resize: vertical; line-height: 1.55; }
input[type=checkbox], input[type=radio] { accent-color: var(--ink); width: 1.05rem; height: 1.05rem; vertical-align: -2px; }

/* ---------- Schaltflächen: Pillenform, primär Ink, sekundär Kontur ---------- */
button, .btn {
  --h: 44px; font: 500 .94rem/1 var(--font-body); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  min-height: var(--h); padding: 0 1.25rem; border-radius: 999px; border: 1px solid var(--line-2); background: transparent; color: var(--ink);
  text-decoration: none; white-space: nowrap; transition: background .25s var(--ease), border-color .25s var(--ease), color .25s var(--ease), transform .25s var(--ease);
}
button:hover, .btn:hover { border-color: var(--ink); }
button.primary, .btn.primary { background: var(--ink); border-color: var(--ink); color: var(--ivory); box-shadow: 0 10px 30px -14px rgba(14, 17, 22, .55); }
button.primary:hover, .btn.primary:hover { background: #1d2129; transform: translateY(-1px); }
button.danger { color: var(--err); border-color: rgba(161, 42, 42, .35); }
button.danger:hover { border-color: var(--err); }
button.sm, .btn.sm { --h: 34px; padding: 0 .9rem; font-size: .86rem; }
button.link { border: 0; background: none; padding: 0; min-height: 0; color: var(--brass); text-decoration: underline; text-underline-offset: 3px; border-radius: 0; }
button:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn svg, button svg { width: 16px; height: 16px; flex: none; }
.big { width: 100%; --h: 52px; font-size: 1rem; }
.row { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: .2rem 1rem; }

/* ---------- Hinweise, Marken ---------- */
.alert { padding: .8rem 1rem; border-radius: var(--radius-sm); margin: .8rem 0; border: 1px solid; font-size: .94rem; }
.alert.err { color: var(--err); border-color: rgba(161, 42, 42, .35); background: #FBF0EE; }
.alert.ok { color: var(--ok); border-color: rgba(46, 107, 63, .35); background: #EEF5EF; }
.alert.info { color: var(--ink); border-color: rgba(160, 126, 70, .35); background: #FBF6EC; }
.pill { display: inline-flex; align-items: center; gap: .3rem; padding: .15rem .6rem; border-radius: 999px; font-size: .76rem; font-weight: 500; border: 1px solid var(--line-2); background: var(--white); color: var(--ink-2); white-space: nowrap; }
.pill.ok { border-color: rgba(46, 107, 63, .4); color: var(--ok); background: #F1F7F2; }
.pill.warn { border-color: rgba(138, 90, 0, .35); color: var(--warn); background: #FBF5E8; }
.pill.gold { border-color: rgba(160, 126, 70, .45); color: var(--brass); background: var(--brass-soft); }
.pill.dark { background: var(--ink); color: var(--ivory); border-color: var(--ink); }

/* ---------- Tabellen ---------- */
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: .6rem .6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font: 500 .72rem/1.3 var(--font-body); letter-spacing: .12em; text-transform: uppercase; color: var(--stone); background: transparent; border-bottom-color: var(--line-2); }
tbody tr:hover td { background: rgba(160, 126, 70, .04); }
.table-wrap { overflow-x: auto; }

.tabs { display: flex; gap: .2rem; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--line); margin-bottom: 1.2rem; }
.tabs button { border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: none; white-space: nowrap; flex: 0 0 auto; padding: 0 .9rem; color: var(--stone); }
.tabs button:hover { color: var(--ink); }
.tabs button[aria-selected=true] { border-bottom-color: var(--brass); color: var(--ink); font-weight: 600; }

dialog { border: 1px solid var(--line); border-radius: var(--radius); max-width: 540px; width: calc(100% - 2rem); background: var(--panel); box-shadow: var(--shadow); padding: 1.6rem; color: var(--ink); }
dialog::backdrop { background: rgba(14, 17, 22, .55); }
.secret { font-family: ui-monospace, Consolas, monospace; font-size: 1.1rem; background: var(--ivory-2); padding: .45rem .7rem; border-radius: var(--radius-sm); display: inline-block; user-select: all; }

/* ---------- Mobile Erfassung ---------- */
.app main { max-width: 640px; }
.chips { display: flex; flex-wrap: wrap; gap: .45rem; }
.chips input { position: absolute; opacity: 0; }
.chips label { margin: 0; font-weight: 500; font-size: .9rem; border: 1px solid var(--line-2); border-radius: 999px; padding: .5rem 1rem; cursor: pointer; min-height: 44px; display: inline-flex; align-items: center; background: var(--white); }
.chips input:checked + label { background: var(--ink); color: var(--ivory); border-color: var(--ink); }
.chips input:focus-visible + label { outline: 2px solid var(--brass); outline-offset: 2px; }
.rec { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; }
.rec .dot { width: .7rem; height: .7rem; border-radius: 50%; background: var(--err); display: inline-block; animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .3; } }
@media (prefers-reduced-motion: reduce) { .rec .dot { animation: none; } * { transition: none !important; } }
.obs { border-bottom: 1px solid var(--line); padding: .9rem 0; }
.obs:last-child { border-bottom: 0; }
.steps { margin: .4rem 0 0; padding-left: 1.3rem; }
details summary { cursor: pointer; padding: .4rem 0; }
