﻿/* Leihliste – Design im bysalty-Stil (Orange #ff5517, Archivo, dunkel) */
@font-face {
  font-family: "Archivo"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("/assets/fonts/archivo-latin-wght.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
:root {
  --bg: #0a0a0c; --bg-2: #101014; --surface: #17171d; --line: rgba(255, 255, 255, .09);
  --text: #f4f4f6; --muted: #a6a6b2; --orange: #ff5517; --amber: #ff8a1f; --glow: color-mix(in srgb, var(--orange) 45%, transparent);
  --ok: #3ddc84; --bad: #ff4d4f;
  --grad: linear-gradient(100deg, #ff5517 0%, #ff8a1f 55%, #ffb347 100%);
  --radius: 18px; --max: 980px; --gutter: clamp(16px, 4vw, 40px);
  --font: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overflow-x: clip; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 1rem; line-height: 1.55; -webkit-font-smoothing: antialiased; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { line-height: 1.1; letter-spacing: -.02em; font-weight: 900; }
::selection { background: var(--orange); color: #0a0a0c; }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 3px; border-radius: 6px; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { width: min(100% - 2 * var(--gutter), var(--max)); margin-inline: auto; }
.muted { color: var(--muted); }

/* Hintergrund */
.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; }
.blob { position: absolute; border-radius: 50%; filter: blur(80px); opacity: .4; animation: drift 20s ease-in-out infinite alternate; }
.blob--1 { width: 50vmax; height: 50vmax; left: -18vmax; top: -24vmax; background: radial-gradient(circle, var(--orange), transparent 65%); }
.blob--2 { width: 40vmax; height: 40vmax; right: -14vmax; bottom: -22vmax; background: radial-gradient(circle, var(--amber), transparent 65%); animation-duration: 26s; opacity: .3; }
@keyframes drift { to { transform: translate3d(5vmax, 4vmax, 0) scale(1.15); } }
.grid-lines { position: absolute; inset: 0; opacity: .4;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px); background-size: 72px 72px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, #000 20%, transparent 75%); }

/* Spinner */
.spinner { display: none; width: 1.1em; height: 1.1em; border-radius: 50%; border: 3px solid rgba(10, 10, 12, .25); border-top-color: #0a0a0c; animation: spin .75s linear infinite; }
.spinner--lg { display: block; width: 46px; height: 46px; border-width: 4px; border-color: rgba(255, 255, 255, .1); border-top-color: var(--orange); box-shadow: 0 0 24px -6px var(--glow); }
.is-loading .spinner { display: inline-block; }
.is-loading .btn__label { opacity: .6; }
.btn--ghost .spinner { border-color: rgba(255, 255, 255, .2); border-top-color: var(--orange); }
@keyframes spin { to { transform: rotate(360deg); } }

.loader { position: fixed; inset: 0; z-index: 300; display: grid; place-content: center; justify-items: center; gap: 22px; background: var(--bg); transition: opacity .4s, visibility .4s; }
.loader.is-done { opacity: 0; visibility: hidden; }
.loader img { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.1); filter: drop-shadow(0 0 16px var(--glow)); } }

/* Buttons */
.btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px; padding: 13px 26px; border-radius: 999px; font: inherit; font-weight: 800; cursor: pointer;
  border: 2px solid transparent; overflow: hidden; isolation: isolate; transition: transform .25s var(--ease), box-shadow .3s, background .3s, border-color .3s; }
.btn:disabled { cursor: progress; }
.btn--primary { background: var(--grad); color: #0a0a0c; box-shadow: 0 10px 34px -10px var(--glow); }
.btn--primary::before { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .55) 50%, transparent 70%); transform: translateX(-120%); z-index: -1; }
.btn--primary:hover::before { transform: translateX(120%); transition: transform .8s var(--ease); }
.btn--primary:hover { box-shadow: 0 16px 46px -8px var(--glow); transform: translateY(-1px); }
.btn--ghost { border-color: var(--line); background: rgba(255, 255, 255, .03); color: var(--text); }
.btn--ghost:hover { border-color: var(--orange); background: color-mix(in srgb, var(--orange) 10%, transparent); }
.btn--sm { padding: 9px 18px; font-size: .92rem; }

/* Formulare */
.form { display: grid; gap: 16px; }
.form label { display: grid; gap: 6px; font-weight: 700; font-size: .92rem; color: var(--muted); }
.form small { font-weight: 500; opacity: .8; }
.form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
input, select { width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg-2); color: var(--text); font: inherit; font-size: 1rem; transition: border-color .2s, box-shadow .2s; }
input:focus, select:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 3px color-mix(in srgb, var(--orange) 25%, transparent); }
.alert { padding: 11px 14px; border-radius: 12px; background: rgba(255, 77, 79, .12); border: 1px solid rgba(255, 77, 79, .4); color: #ffb3b4; font-size: .94rem; }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: .8rem; letter-spacing: .18em; text-transform: uppercase; color: var(--amber); }
.eyebrow::before { content: ""; width: 30px; height: 3px; background: var(--grad); border-radius: 3px; }

/* Login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px var(--gutter); }
.login__card { width: min(100%, 420px); display: grid; gap: 14px; padding: clamp(26px, 6vw, 40px); border-radius: 28px; border: 1px solid color-mix(in srgb, var(--orange) 30%, transparent);
  background: radial-gradient(700px circle at 90% 0%, color-mix(in srgb, var(--orange) 22%, transparent), transparent 60%), linear-gradient(160deg, #1b1210, #0f0f13 70%); box-shadow: 0 40px 90px -40px color-mix(in srgb, var(--orange) 45%, transparent); }
.login__card h1 { font-size: 2.2rem; text-transform: uppercase; }
.login .form { margin-top: 8px; }
.login .btn { width: 100%; }
.foot { text-align: center; font-size: .85rem; color: var(--muted); padding: 28px 0 40px; }
.foot a:hover { color: var(--amber); }

/* Header */
.header { position: sticky; top: 0; z-index: 100; background: rgba(10, 10, 12, .78); backdrop-filter: blur(16px) saturate(1.4); border-bottom: 1px solid var(--line); }
.header__in { display: flex; align-items: center; justify-content: space-between; height: 68px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 12px; font-weight: 900; letter-spacing: .04em; font-size: 1.1rem; text-transform: uppercase; }
.header__right { display: flex; align-items: center; gap: 14px; }
.user { font-size: .9rem; }

/* App */
.app { padding: 28px 0 10px; display: grid; gap: 22px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.stat { padding: 18px 20px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); display: grid; gap: 2px; }
.stat__n { font-size: clamp(2rem, 6vw, 2.8rem); font-weight: 900; line-height: 1; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat--warn .stat__n { background: none; color: var(--bad); }
.stat__l { color: var(--muted); font-weight: 700; font-size: .88rem; text-transform: uppercase; letter-spacing: .08em; }
.toolbar { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; }
.toolbar__right { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.search { width: 190px; padding: 9px 14px; border-radius: 999px; }
.tabs { display: flex; gap: 6px; padding: 5px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); overflow-x: auto; }
.tab { padding: 8px 16px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font: inherit; font-weight: 800; font-size: .92rem; cursor: pointer; white-space: nowrap; transition: color .2s, background .2s; }
.tab:hover { color: var(--text); }
.tab.is-on { background: var(--grad); color: #0a0a0c; }
.view { display: grid; gap: 12px; }
.items-head { display: flex; justify-content: flex-end; }
.empty { text-align: center; color: var(--muted); padding: 48px 12px; border: 1px dashed var(--line); border-radius: var(--radius); }

.row-card { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 18px 20px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); transition: border-color .3s, transform .25s var(--ease); animation: in .4s var(--ease) both; }
.row-card:hover { border-color: color-mix(in srgb, var(--orange) 55%, transparent); }
.row-card--late { border-color: rgba(255, 77, 79, .5); }
.row-card--dim { opacity: .6; }
.row-card h3 { font-size: 1.25rem; text-transform: uppercase; margin-bottom: 4px; }
.row-card .note { font-size: .92rem; margin-top: 4px; color: #d0d0d8; }
.row-card__side { display: grid; gap: 10px; justify-items: end; flex: none; }
.row-card__actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
@keyframes in { from { opacity: 0; transform: translateY(10px); } }
.pill { padding: 4px 12px; border-radius: 999px; border: 1px solid var(--line); font-size: .8rem; font-weight: 800; white-space: nowrap; color: var(--muted); }
.pill--ok { color: var(--ok); border-color: rgba(61, 220, 132, .4); background: rgba(61, 220, 132, .08); }
.pill--late { color: var(--bad); border-color: rgba(255, 77, 79, .5); background: rgba(255, 77, 79, .1); }

/* Skeleton */
.skel { min-height: 84px; position: relative; overflow: hidden; }
.skel::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .06) 50%, transparent 70%); transform: translateX(-100%); animation: shimmer 1.3s infinite; }
@keyframes shimmer { to { transform: translateX(100%); } }

/* Dialoge & Toasts */
.dlg { width: min(100% - 32px, 460px); padding: 26px; border-radius: 24px; border: 1px solid color-mix(in srgb, var(--orange) 35%, transparent); background: linear-gradient(160deg, #1b1210, #0f0f13 70%); color: var(--text); box-shadow: 0 40px 90px -30px #000; }
.dlg::backdrop { background: rgba(5, 5, 7, .7); backdrop-filter: blur(4px); }
.dlg[open] { animation: in .3s var(--ease); }
.dlg h2 { font-size: 1.5rem; text-transform: uppercase; }
.dlg__actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 6px; }
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 400; display: grid; gap: 8px; }
.toast { padding: 12px 18px; border-radius: 14px; background: var(--surface); border: 1px solid color-mix(in srgb, var(--orange) 50%, transparent); box-shadow: 0 16px 40px -12px #000; font-weight: 700; animation: in .3s var(--ease); }
.toast--bad { border-color: var(--bad); }

@media (max-width: 640px) {
  .row-card { flex-direction: column; align-items: stretch; }
  .row-card__side { justify-items: start; }
  .row-card__actions { justify-content: flex-start; }
  .form .row { grid-template-columns: 1fr; }
  .search { width: 100%; }
  .toolbar__right { width: 100%; }
  .toolbar__right .btn { flex: none; }
  .user { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .spinner { animation-duration: 1.5s !important; animation-iteration-count: infinite !important; }
}

/* ---------- Akzentfarben ---------- */
body.acc-blue   { --orange: #2f8bff; --amber: #4fc3ff; --glow: rgba(47, 139, 255, .45);  --grad: linear-gradient(100deg, #2f8bff 0%, #4fc3ff 55%, #8be0ff 100%); }
body.acc-green  { --orange: #1fbf75; --amber: #5be3a0; --glow: rgba(31, 191, 117, .45);  --grad: linear-gradient(100deg, #1fbf75 0%, #5be3a0 55%, #b6f5d2 100%); }
body.acc-violet { --orange: #8b5cf6; --amber: #c084fc; --glow: rgba(139, 92, 246, .45);  --grad: linear-gradient(100deg, #8b5cf6 0%, #c084fc 55%, #e9c8ff 100%); }
body.acc-pink   { --orange: #ff2d6f; --amber: #ff7aa8; --glow: rgba(255, 45, 111, .45);  --grad: linear-gradient(100deg, #ff2d6f 0%, #ff7aa8 55%, #ffc2d6 100%); }
body.acc-orange { --glow: rgba(255, 85, 23, .45); }

/* ---------- Einstellungen ---------- */
.dlg--wide { width: min(100% - 32px, 560px); max-height: calc(100dvh - 32px); overflow-y: auto; overscroll-behavior: contain; }
.dlg fieldset { margin: 0; padding: 16px 16px 18px; border: 1px solid var(--line); border-radius: 16px; display: grid; gap: 14px; min-width: 0; }
.dlg legend { padding: 0 8px; font-weight: 800; font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; color: var(--amber); }
.check { display: flex !important; flex-direction: row; align-items: center; gap: 10px !important; color: var(--text) !important; font-weight: 600 !important; cursor: pointer; }
.check input, .swatch input { width: 1.15rem; height: 1.15rem; padding: 0; accent-color: var(--orange); flex: none; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch { display: inline-flex !important; flex-direction: row; align-items: center; gap: 8px !important; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); cursor: pointer; color: var(--text) !important; font-weight: 700 !important; }
.swatch::before { content: ""; width: 14px; height: 14px; border-radius: 50%; background: var(--c); box-shadow: 0 0 10px -1px var(--c); }
.swatch:has(input:checked) { border-color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent); }
.swatch input { position: absolute; opacity: 0; pointer-events: none; }
.swatch:has(input:focus-visible) { outline: 3px solid var(--amber); outline-offset: 2px; }
.swatch--orange { --c: #ff5517; } .swatch--blue { --c: #2f8bff; } .swatch--green { --c: #1fbf75; } .swatch--violet { --c: #8b5cf6; } .swatch--pink { --c: #ff2d6f; }
.inline { display: flex; flex-wrap: wrap; gap: 10px; }
.pill--soon { color: var(--amber); border-color: color-mix(in srgb, var(--amber) 55%, transparent); background: color-mix(in srgb, var(--amber) 10%, transparent); }
.btn svg { flex: none; }

/* Kompakt */
.compact .row-card { padding: 10px 16px; }
.compact .row-card h3 { font-size: 1.05rem; margin-bottom: 0; }
.compact .view { gap: 8px; }
.compact .row-card .note { display: none; }
.compact .stat { padding: 12px 16px; }

/* Animationen aus */
.no-anim *, .no-anim *::before, .no-anim *::after { animation: none !important; transition: none !important; }
.no-anim .blob { opacity: .22; }

/* Rechtliches */
.legal { padding: 28px 0 10px; display: grid; gap: 18px; max-width: 760px; }
.legal h1 { font-size: clamp(2rem, 6vw, 3rem); text-transform: uppercase; }
.prose h2 { font-size: 1.15rem; text-transform: uppercase; margin: 1.8em 0 .5em; }
.prose h2:first-child { margin-top: 0; }
.prose p { color: #d0d0d8; margin-bottom: 1em; }
.prose a { color: var(--amber); text-decoration: underline; text-underline-offset: 3px; }
.prose a:hover { color: var(--text); }
@media (max-width: 640px) { #btn-settings span { display: none; } }

/* ---------- Sets, Ausleiher, Protokoll ---------- */
.row-card--group { flex-direction: column; align-items: stretch; gap: 12px; }
.row-card__top { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.sn { font-weight: 600; font-size: .78rem; color: var(--muted); letter-spacing: 0; text-transform: none; }
.subs { list-style: none; margin: 0; padding: 10px 0 0; border-top: 1px dashed var(--line); display: grid; gap: 8px; }
.subs li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-left: 4px; font-size: .94rem; }
.subs li.is-back .subs__name { opacity: .55; text-decoration: line-through; text-decoration-color: var(--line); }
.subs__name { font-weight: 700; }
.subs__btns { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.btn--xs { padding: 4px 12px; font-size: .8rem; }
.acc-list { display: grid; gap: 10px; }
.form.is-edit .only-new { display: none !important; }
.form .only-returned { display: none; }
.form.is-returned .only-returned { display: grid; }
.hint { font-size: .88rem; }
.log { display: grid; grid-template-columns: 8.5rem auto 1fr; gap: 12px; align-items: baseline; padding: 12px 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); font-size: .93rem; }
.log__time { color: var(--muted); font-variant-numeric: tabular-nums; font-size: .85rem; }
.log__tag { justify-self: start; }
.log__tag--delete { color: var(--bad); border-color: rgba(255, 77, 79, .5); }
.log__tag--create, .log__tag--return { color: var(--ok); border-color: rgba(61, 220, 132, .4); }
.log__tag--extend, .log__tag--update { color: var(--amber); border-color: color-mix(in srgb, var(--amber) 50%, transparent); }
.log__text { overflow-wrap: anywhere; }
.view > .btn { justify-self: center; }
@media (max-width: 640px) {
  .row-card__top { flex-direction: column; align-items: stretch; }
  .log { grid-template-columns: 1fr; gap: 4px; }
}
