/* MELO Inventar & Ausleihe – ein Stylesheet für alle Seiten */

@font-face { font-family: "Atkinson"; src: url("fonts/AtkinsonHyperlegible-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Atkinson"; src: url("fonts/AtkinsonHyperlegible-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Atkinson"; src: url("fonts/AtkinsonHyperlegible-Italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }

:root {
  --bg: #efefec;
  --surface: #ffffff;
  --surface-2: #f7f7f5;
  --ink: #23211f;
  --ink-2: #4a4743;
  --muted: #6c6964;
  --line: #dcdbd6;
  --line-strong: #c4c2bc;

  --brand: #e7461c;        /* MELO-Orange (Logo) */
  --brand-dark: #b9360f;   /* Orange für Text/Links, kontraststark */
  --brand-soft: #fdebe5;
  --gray: #9c9c9c;         /* MELO-Grau (Logo) */

  --ok: #2b7a4b;   --ok-soft: #e2f1e7;
  --info: #1f5f99; --info-soft: #e3eef8;
  --warn: #8a5a00; --warn-soft: #fbf0d6;
  --bad: #b42318;  --bad-soft: #fbe3df;

  --r-s: 6px;
  --r-m: 10px;
  --gap: 16px;
  --page: 1180px;
  --font: "Atkinson", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.5 var(--font);
  min-height: 100vh; display: flex; flex-direction: column;
}
img { max-width: 100%; }
a { color: var(--brand-dark); text-underline-offset: 2px; }
a:hover { color: var(--brand); }
:focus-visible { outline: 3px solid var(--info); outline-offset: 2px; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.25rem; margin-top: 1.6em; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 .8em; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.nowrap { white-space: nowrap; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: #fff; padding: 8px 12px; z-index: 100; }
.skip:focus { left: 8px; }

/* ---------- Kopfzeile ---------- */
.topbar { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.topbar::after { content: ""; display: block; height: 3px; background: var(--brand); }
.topbar__inner { max-width: var(--page); margin: 0 auto; padding: 8px 16px; display: flex; align-items: center; gap: 18px; min-height: 58px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); flex: none; }
.brand img { height: 38px; width: auto; }
.brand__name { font-weight: 700; font-size: 1.1rem; letter-spacing: .02em; line-height: 1.05; }
.brand__sub { display: block; font-weight: 400; font-size: .75rem; letter-spacing: 0; color: var(--muted); }
.mainnav { display: flex; gap: 2px; flex-wrap: wrap; flex: 1; }
.mainnav a {
  color: var(--ink-2); text-decoration: none; padding: 8px 10px; border-radius: var(--r-s);
  font-size: .95rem; position: relative; white-space: nowrap;
}
.mainnav a:hover { background: var(--surface-2); color: var(--ink); }
.mainnav a[aria-current="page"] { color: var(--ink); font-weight: 700; }
.mainnav a[aria-current="page"]::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -11px; height: 3px; background: var(--ink); }
.count { display: inline-block; min-width: 1.4em; padding: 0 .35em; border-radius: 99px; background: var(--brand); color: #fff; font-size: .75rem; font-weight: 700; text-align: center; line-height: 1.4em; }
.topbar__end { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.quicksearch input { width: 200px; padding: 7px 10px; border: 1px solid var(--line); border-radius: var(--r-s); background: var(--surface-2); font: inherit; font-size: .9rem; }
.quicksearch input:focus { background: #fff; }
.usermenu { position: relative; }
.usermenu summary { list-style: none; cursor: pointer; padding: 7px 10px; border-radius: var(--r-s); border: 1px solid var(--line); font-size: .9rem; }
.usermenu summary::-webkit-details-marker { display: none; }
.usermenu summary::after { content: " ▾"; color: var(--muted); }
.usermenu__panel { position: absolute; right: 0; top: calc(100% + 6px); background: #fff; border: 1px solid var(--line); border-radius: var(--r-m); padding: 12px; min-width: 220px; box-shadow: 0 10px 30px rgba(0,0,0,.12); }
.usermenu__panel a { display: block; padding: 6px 0; }
.usermenu__name { font-weight: 700; margin: 0; }
.nav-toggle { display: none; }

@media (max-width: 1020px) {
  .topbar__inner { flex-wrap: wrap; }
  .nav-toggle { display: inline-block; margin-left: auto; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-s); padding: 7px 12px; font: inherit; }
  .mainnav { display: none; order: 10; flex-basis: 100%; flex-direction: column; padding-bottom: 8px; }
  .mainnav.is-open { display: flex; }
  .mainnav a[aria-current="page"]::after { left: 0; right: auto; top: 8px; bottom: 8px; width: 3px; height: auto; }
  .topbar__end { order: 5; margin-left: 0; }
  .quicksearch input { width: 150px; }
}
@media (max-width: 520px) { .quicksearch { display: none; } .brand__sub { display: none; } }

/* ---------- Seitengerüst ---------- */
.page { width: 100%; max-width: var(--page); margin: 0 auto; padding: 24px 16px 56px; flex: 1; }
.page--narrow { max-width: 760px; }
.page--wide { max-width: 1400px; }
.footer { max-width: var(--page); width: 100%; margin: 0 auto; padding: 16px; display: flex; gap: 16px; color: var(--muted); font-size: .85rem; }
.backlink { margin: 0 0 8px; font-size: .95rem; }
.backlink a { text-decoration: none; }
.pagehead { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.pagehead h1 { margin: 0; }
.pagehead__sub { color: var(--muted); margin: 4px 0 0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- Flächen ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); padding: 20px; margin-bottom: var(--gap); }
.panel > h2:first-child, .panel > h3:first-child { margin-top: 0; }
.panel--flush { padding: 0; overflow: hidden; }
.panel__head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.panel__head h2, .panel__head h3 { margin: 0; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); }
.layout-side { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: var(--gap); align-items: start; }
@media (max-width: 900px) { .grid-2, .grid-3, .layout-side { grid-template-columns: 1fr; } }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 16px; border-radius: var(--r-s); border: 1px solid var(--brand);
  background: var(--brand); color: #fff; font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; line-height: 1.2;
}
.btn:hover { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }
.btn--ghost { background: #fff; color: var(--ink); border-color: var(--line-strong); }
.btn--ghost:hover { background: var(--surface-2); color: var(--ink); border-color: var(--ink-2); }
.btn--danger { background: #fff; color: var(--bad); border-color: var(--bad); }
.btn--danger:hover { background: var(--bad); color: #fff; border-color: var(--bad); }
.btn--small { padding: 5px 10px; font-size: .875rem; }
.btn--big { padding: 13px 22px; font-size: 1.05rem; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--brand-dark); text-decoration: underline; font: inherit; cursor: pointer; }

/* ---------- Formulare ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.form-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid .span-2 { grid-column: span 2; }
@media (max-width: 700px) { .form-grid, .form-grid--3 { grid-template-columns: 1fr; } .form-grid .span-2 { grid-column: auto; } }
.field { margin-bottom: 14px; }
.field label { display: block; font-weight: 700; margin-bottom: 4px; font-size: .95rem; }
.req { color: var(--brand-dark); }
input[type=text], input[type=search], input[type=email], input[type=url], input[type=number], input[type=date],
input[type=time], input[type=datetime-local], input[type=password], select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--line-strong); border-radius: var(--r-s);
  font: inherit; background: #fff; color: var(--ink);
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(31, 95, 153, .25); border-color: var(--info); }
.field--error input, .field--error select, .field--error textarea { border-color: var(--bad); }
.field__error { color: var(--bad); font-size: .875rem; margin: 4px 0 0; }
.field__hint { color: var(--muted); font-size: .85rem; margin: 4px 0 0; }
.check { display: flex; gap: 8px; align-items: flex-start; margin: 6px 0; cursor: pointer; }
.check input { margin-top: 4px; width: 17px; height: 17px; flex: none; }
.check__hint { margin: -2px 0 10px 25px; }
fieldset { border: 0; padding: 0; margin: 0 0 14px; }
legend { font-weight: 700; margin-bottom: 6px; padding: 0; }
.choice-row { display: flex; gap: 8px; flex-wrap: wrap; }
.choice { display: flex; gap: 8px; align-items: center; border: 1px solid var(--line-strong); border-radius: var(--r-s); padding: 9px 12px; cursor: pointer; background: #fff; }
.choice:has(input:checked) { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.form-section { border-top: 1px solid var(--line); padding-top: 18px; margin-top: 8px; }
.form-section:first-of-type { border-top: 0; padding-top: 0; margin-top: 0; }
.form-section > h2 { margin-top: 0; font-size: 1.1rem; }
details.more { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 12px; }
details.more > summary { cursor: pointer; font-weight: 700; color: var(--ink-2); margin-bottom: 12px; }
.formbar { position: sticky; bottom: 0; background: rgba(255, 255, 255, .97); padding: 12px 20px; margin-left: -20px; margin-right: -20px; margin-bottom: -20px; border-radius: 0 0 var(--r-m) var(--r-m); display: flex; gap: 10px; flex-wrap: wrap; border-top: 1px solid var(--line); margin-top: 8px; z-index: 5; }

.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 14px; }
.filters .field { margin: 0; min-width: 160px; }
.filters .field--grow { flex: 1; min-width: 220px; }

/* ---------- Hinweise ---------- */
.notice { border-radius: var(--r-m); padding: 12px 14px; margin-bottom: 14px; border: 1px solid; }
.notice ul { margin: 6px 0 0 18px; padding: 0; }
.notice--success { background: var(--ok-soft); border-color: #b9dcc5; }
.notice--error { background: var(--bad-soft); border-color: #f0bbb3; }
.notice--warn { background: var(--warn-soft); border-color: #ecd59c; }
.notice--info { background: var(--info-soft); border-color: #b8d3ec; }
.errorbox { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); padding: 28px; }
.debug { white-space: pre-wrap; font-size: .8rem; background: var(--surface-2); padding: 12px; overflow: auto; }
.empty { text-align: left; padding: 28px; border: 1px dashed var(--line-strong); border-radius: var(--r-m); background: var(--surface); }
.empty__title { font-weight: 700; font-size: 1.05rem; margin-bottom: 4px; }

/* ---------- Status-Markierungen ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: .82rem; padding: 2px 9px 2px 8px; border-radius: 99px; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; border: 1px solid var(--line); }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--gray); }
.badge--ok { background: var(--ok-soft); border-color: transparent; color: #1e5a37; } .badge--ok::before { background: var(--ok); }
.badge--info { background: var(--info-soft); border-color: transparent; color: #194d7d; } .badge--info::before { background: var(--info); }
.badge--warn { background: var(--warn-soft); border-color: transparent; color: #6b4600; } .badge--warn::before { background: #c68a00; }
.badge--bad { background: var(--bad-soft); border-color: transparent; color: #8f1c13; } .badge--bad::before { background: var(--bad); }
.tag { display: inline-block; font-size: .8rem; padding: 1px 8px; border-radius: 99px; background: var(--brand-soft); color: #8a2a0c; margin: 0 4px 4px 0; }

/* ---------- Tabellen ---------- */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); }
table.list { width: 100%; border-collapse: collapse; font-size: .95rem; }
.list th, .list td { padding: 10px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.list th { font-size: .85rem; color: var(--muted); font-weight: 700; background: var(--surface-2); white-space: nowrap; }
.list th a { color: inherit; text-decoration: none; }
.list th a:hover { color: var(--ink); }
.list tbody tr:last-child td { border-bottom: 0; }
.list tbody tr:hover { background: #fbfaf8; }
.list td.num, .list th.num { text-align: right; }
.list .col-check { width: 36px; }
.list .title { font-weight: 700; color: var(--ink); text-decoration: none; }
.list .title:hover { color: var(--brand-dark); text-decoration: underline; }
.list .sub { display: block; color: var(--muted); font-size: .85rem; }
.thumb { width: 44px; height: 44px; object-fit: cover; border-radius: var(--r-s); border: 1px solid var(--line); background: var(--surface-2); display: block; }
.thumb--empty { display: flex; align-items: center; justify-content: center; color: var(--line-strong); font-size: 1.2rem; }
.invnr { font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 760px) {
  table.list.stack thead { display: none; }
  table.list.stack, .list.stack tbody, .list.stack tr, .list.stack td { display: block; width: 100%; }
  .list.stack tr { border-bottom: 1px solid var(--line); padding: 8px 4px; }
  .list.stack td { border: 0; padding: 3px 10px; }
  .list.stack td[data-label]::before { content: attr(data-label) ": "; color: var(--muted); font-size: .85rem; }
  .list.stack .col-check { width: auto; }
}

.bulkbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 10px 12px; background: var(--ink); color: #fff; border-radius: var(--r-m); margin-bottom: 10px; }
.bulkbar[hidden] { display: none; }
.bulkbar select { width: auto; }
.bulkbar .btn--ghost { background: transparent; color: #fff; border-color: #777; }

.pager { display: flex; gap: 16px; align-items: center; justify-content: center; margin: 16px 0; }

/* ---------- Datenblatt ---------- */
.facts { display: grid; grid-template-columns: minmax(130px, 34%) 1fr; gap: 0; margin: 0; }
.facts dt { color: var(--muted); padding: 7px 0; border-bottom: 1px solid var(--line); font-size: .92rem; }
.facts dd { margin: 0; padding: 7px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.facts dt:last-of-type, .facts dd:last-of-type { border-bottom: 0; }
.pre { white-space: pre-wrap; }
.statusline { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 6px 0 0; }
.item-hero { display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: start; }
.item-image { width: 100%; border-radius: var(--r-m); border: 1px solid var(--line); background: #fff; }
.qrbox { text-align: center; }
.qrbox #qrcode { display: inline-block; padding: 8px; background: #fff; }
.qrbox #qrcode img, .qrbox #qrcode canvas { width: 160px !important; height: 160px !important; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { padding: 8px 0 8px 16px; border-left: 2px solid var(--line); position: relative; font-size: .92rem; }
.timeline li::before { content: ""; position: absolute; left: -5px; top: 14px; width: 8px; height: 8px; border-radius: 50%; background: var(--line-strong); }
.timeline time { display: block; color: var(--muted); font-size: .82rem; }

/* ---------- Übersicht ---------- */
.greeting { font-size: 1.6rem; margin-bottom: 4px; }
.task-list { list-style: none; margin: 0; padding: 0; }
.task-list li { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.task-list li:last-child { border-bottom: 0; }
.task-list .when { font-variant-numeric: tabular-nums; color: var(--ink-2); white-space: nowrap; }
.stat-row { display: flex; gap: 28px; flex-wrap: wrap; margin: 6px 0 14px; }
.stat strong { display: block; font-size: 1.5rem; line-height: 1.1; }
.stat span { color: var(--muted); font-size: .88rem; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.tile { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); padding: 16px; text-decoration: none; color: var(--ink); }
.tile:hover { border-color: var(--ink-2); color: var(--ink); }
.tile__title { font-weight: 700; display: block; margin-bottom: 2px; }
.tile__meta { color: var(--muted); font-size: .88rem; }

/* ---------- Buchen: Stundenraster ---------- */
.book-steps { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: var(--gap); align-items: start; }
@media (max-width: 980px) { .book-steps { grid-template-columns: 1fr; } }
.step-title { display: flex; align-items: baseline; gap: 10px; margin: 0 0 12px; font-size: 1.15rem; }
.step-title .step-no { display: inline-flex; width: 26px; height: 26px; border-radius: 50%; background: var(--ink); color: #fff; font-size: .85rem; align-items: center; justify-content: center; flex: none; }
.weeknav { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; flex-wrap: wrap; }
.weeknav strong { margin-left: 4px; }

.slotgrid { display: grid; grid-template-columns: 74px repeat(5, minmax(0, 1fr)); border: 1px solid var(--line-strong); border-radius: var(--r-m); overflow: hidden; background: var(--line); gap: 1px; user-select: none; touch-action: none; }
.slotgrid__corner, .slotgrid__day, .slotgrid__period { background: var(--surface-2); padding: 6px 8px; font-size: .82rem; }
.slotgrid__day { text-align: center; font-weight: 700; }
.slotgrid__day.is-today { color: var(--brand-dark); }
.slotgrid__day small { display: block; font-weight: 400; color: var(--muted); }
.slotgrid__period { color: var(--ink-2); line-height: 1.15; }
.slotgrid__period small { display: block; color: var(--muted); font-variant-numeric: tabular-nums; font-size: .74rem; }
.slot {
  background: #fff; border: 0; font: inherit; font-size: .78rem; min-height: 40px; cursor: pointer; color: var(--muted);
  display: flex; align-items: center; justify-content: center; padding: 2px; position: relative;
}
.slot:hover { background: #fff6f2; }
.slot.is-past { background: repeating-linear-gradient(135deg, #f4f4f2 0 6px, #ecebe8 6px 7px); cursor: not-allowed; color: transparent; }
.slot.is-partial { background: var(--warn-soft); color: var(--warn); }
.slot.is-full { background: var(--bad-soft); color: var(--bad); }
.slot.is-selected { background: var(--brand); color: #fff; font-weight: 700; }
.slot.is-selected.is-partial, .slot.is-selected.is-full { background: var(--brand-dark); }
.slotlegend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .82rem; color: var(--muted); margin-top: 8px; }
.slotlegend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; border: 1px solid var(--line-strong); }
@media (max-width: 640px) {
  .slotgrid { grid-template-columns: 52px repeat(5, minmax(0, 1fr)); }
  .slotgrid__period small { display: none; }
  .slot { min-height: 36px; }
}
.timepick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }

.picklist { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--r-m); background: #fff; }
.pick { display: grid; grid-template-columns: 28px 52px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--line); cursor: pointer; }
.pick:last-child { border-bottom: 0; }
.pick input { width: 18px; height: 18px; }
.pick.is-busy { cursor: not-allowed; background: var(--surface-2); }
.pick.is-busy .pick__name { color: var(--muted); }
.pick:has(input:checked) { background: #fff6f2; }
.pick__name { font-weight: 700; display: block; }
.pick__meta { color: var(--muted); font-size: .85rem; display: block; }
.pick__busy { color: var(--bad); font-size: .85rem; display: block; }
.groupline { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 12px; background: var(--surface-2); border-bottom: 1px solid var(--line); font-weight: 700; }

.summary { position: sticky; top: 84px; }
.summary__when { font-size: 1.1rem; font-weight: 700; margin: 0 0 6px; }
.summary__list { margin: 8px 0 12px; padding-left: 18px; max-height: 220px; overflow: auto; }

/* ---------- Ausgabe/Rückgabe ---------- */
.deskcard { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); align-items: center; }
.deskcard:last-child { border-bottom: 0; }
.deskcard__title { font-weight: 700; }
.deskcard__meta { color: var(--muted); font-size: .88rem; }
.deskcard.is-overdue { box-shadow: inset 4px 0 0 var(--bad); }
.deskcard details { margin-top: 6px; font-size: .88rem; }
.returnform { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; justify-content: flex-end; }
.returnform select { width: auto; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; flex-wrap: wrap; }
.tabs a { padding: 9px 14px; text-decoration: none; color: var(--ink-2); border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tabs a[aria-current="page"] { color: var(--ink); font-weight: 700; border-color: var(--ink); }

/* ---------- Medien ---------- */
.media-row { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 14px; padding: 12px 14px; border-bottom: 1px solid var(--line); align-items: start; }
.media-row:last-child { border-bottom: 0; }
.cover { width: 56px; height: 72px; object-fit: cover; border-radius: 4px; border: 1px solid var(--line); background: var(--surface-2); display: block; }
.cover--empty { display: flex; align-items: center; justify-content: center; color: var(--line-strong); }
.copies { margin-top: 8px; }
.copies summary { cursor: pointer; font-size: .9rem; color: var(--brand-dark); }
.copies table { margin-top: 6px; }

/* ---------- Inventur ---------- */
.scanner { max-width: 520px; }
#reader { width: 100%; border-radius: var(--r-m); overflow: hidden; background: #111; min-height: 60px; }
.scanstatus { padding: 12px 14px; border-radius: var(--r-m); background: var(--surface-2); margin: 10px 0; font-weight: 700; }
.scanstatus.ok { background: var(--ok-soft); color: #1e5a37; }
.scanstatus.error { background: var(--bad-soft); color: #8f1c13; }
.scanstatus.warn { background: var(--warn-soft); color: #6b4600; }
.progress { height: 10px; background: var(--surface-2); border-radius: 99px; overflow: hidden; border: 1px solid var(--line); }
.progress > span { display: block; height: 100%; background: var(--ok); }

/* ---------- Login ---------- */
.login { max-width: 460px; margin: 6vh auto 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); padding: 32px; }
.login img { height: 76px; width: auto; margin-bottom: 12px; }
.login h1 { font-size: 1.5rem; }

@media print {
  .topbar, .footer, .formbar, .actions, .bulkbar, .no-print, .backlink, .nav-toggle { display: none !important; }
  body { background: #fff; }
  .page { padding: 0; max-width: none; }
  .panel, .table-wrap { border: 0; padding: 0; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }
.qty { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.choice.is-active { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
a.choice { text-decoration: none; color: var(--ink); }
a.choice[aria-current="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); font-weight: 700; }

@media (max-width: 640px) {
  .task-list li { flex-direction: column; align-items: flex-start; }
  .task-list .when { white-space: normal; }
  .pagehead .actions { width: 100%; }
}
.qty input { padding: 6px 8px; }
input[type=checkbox], input[type=radio] { accent-color: var(--brand-dark); }
[hidden] { display: none !important; }
#reader:empty { display: none; }
.isbn-hit { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 14px; padding: 14px; border: 1px solid var(--ink); border-radius: var(--r-m); background: #fff; margin-bottom: 14px; }
.isbn-hit .cover { width: 72px; height: 96px; }
.isbn-hit__title { font-weight: 700; font-size: 1.05rem; margin: 0 0 2px; }
.isbn-hit p { margin: 0 0 2px; }
#isbn_button { white-space: nowrap; }

/* Office-Keys */
.okey { font-family: ui-monospace, "Cascadia Mono", Consolas, "Liberation Mono", monospace; font-size: .92em; letter-spacing: .02em; white-space: nowrap; }
.field--mono input { font-family: ui-monospace, "Cascadia Mono", Consolas, "Liberation Mono", monospace; letter-spacing: .03em; text-transform: uppercase; }
.field--mono input::placeholder { text-transform: none; }
.okey-count { font-variant-numeric: tabular-nums; }
