/* TREVALON TMS · Farben laut Brandbook v1.0 (Palette 1) */
:root {
  --ink: #0e1116;
  --champagner: #c9a86e;
  --messing: #a07e46;
  --stone: #6b6660;
  --ivory: #f6f3ec;
  --white: #ffffff;
  --line: #ddd6c8;
  --ok: #2e6b3f;
  --warn: #8a5a00;
  --err: #a12a2a;
  --radius: 8px;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--ink);
  background: var(--ivory);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; line-height: 1.5; font-size: 16px; }
h1, h2, h3 { font-family: Sora, Inter, system-ui, sans-serif; line-height: 1.25; margin: 0 0 .6em; }
h1 { font-size: 1.5rem; } h2 { font-size: 1.2rem; } h3 { font-size: 1.05rem; }
a { color: var(--messing); }
:focus-visible { outline: 3px solid var(--champagner); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.topbar { background: var(--ink); color: var(--ivory); display: flex; align-items: center; gap: 1rem; padding: .7rem 1rem; flex-wrap: wrap; }
.brand { font-family: Sora, Inter, sans-serif; letter-spacing: .18em; font-weight: 600; }
.brand .v { color: var(--champagner); }
.topbar .spacer { flex: 1; }
.topbar a, .topbar button.link { color: var(--ivory); }
.topbar .who { color: #cfc8ba; font-size: .9rem; }

main { max-width: 1100px; margin: 0 auto; padding: 1rem; }
main.narrow { max-width: 460px; }
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; margin-bottom: 1rem; }
.muted { color: var(--stone); }
.small { font-size: .88rem; }

label { display: block; font-weight: 600; margin: .8rem 0 .25rem; }
.help { font-size: .88rem; color: var(--stone); margin: 0 0 .3rem; }
input[type=text], input[type=password], input[type=email], input[type=date], input:not([type]), select, textarea {
  width: 100%; padding: .6rem .7rem; font: inherit; border: 1px solid #b9b1a2; border-radius: 6px; background: var(--white); color: var(--ink);
}
textarea { min-height: 9rem; resize: vertical; }
button, .btn {
  font: inherit; cursor: pointer; border: 1px solid var(--ink); background: var(--white); color: var(--ink);
  padding: .55rem .95rem; border-radius: 6px; display: inline-flex; align-items: center; gap: .4rem; text-decoration: none; min-height: 44px;
}
button.primary, .btn.primary { background: var(--ink); color: var(--ivory); }
button.danger { border-color: var(--err); color: var(--err); }
button.link { border: 0; background: none; padding: 0; min-height: 0; text-decoration: underline; color: var(--messing); }
button:disabled { opacity: .55; cursor: not-allowed; }
.row { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: .8rem; }

.alert { padding: .7rem .9rem; border-radius: 6px; margin: .8rem 0; border: 1px solid; }
.alert.err { color: var(--err); border-color: var(--err); background: #fbeeee; }
.alert.ok { color: var(--ok); border-color: var(--ok); background: #eef6f0; }
.alert.info { color: var(--ink); border-color: var(--champagner); background: #fbf6ec; }
.pill { display: inline-block; padding: .1rem .55rem; border-radius: 999px; font-size: .8rem; border: 1px solid var(--line); background: var(--ivory); }
.pill.ok { border-color: var(--ok); color: var(--ok); }
.pill.warn { border-color: var(--warn); color: var(--warn); }

table { width: 100%; border-collapse: collapse; font-size: .93rem; }
th, td { text-align: left; padding: .45rem .5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 600; background: #faf8f3; }
.table-wrap { overflow-x: auto; }

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

dialog { border: 1px solid var(--line); border-radius: var(--radius); max-width: 520px; width: calc(100% - 2rem); }
dialog::backdrop { background: rgba(14, 17, 22, .5); }
.secret { font-family: ui-monospace, Consolas, monospace; font-size: 1.15rem; background: var(--ivory); padding: .5rem .7rem; border-radius: 6px; display: inline-block; user-select: all; }

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