/* AssetLotse – sachliches Asset-Management-Design: Schiefergrau, Petrol, klare Tabellen. */
:root {
  --paper: #f3f5f7;
  --paper-2: #e9edf1;
  --card: #ffffff;
  --ink: #17202a;
  --ink-2: #3c4855;
  --muted: #6b7785;
  --line: #e1e6eb;
  --line-2: #cdd5dd;
  --accent: #0b7285;
  --accent-ink: #ffffff;
  --accent-soft: #e0f1f3;
  --brass: #0b7285;          /* Zweitfarbe (Markenzeichen, Überschriften-Zeile) – hier gleich Petrol */
  --brass-soft: #e0f1f3;
  --brass-ink: #ffffff;
  --danger: #c0392b;
  --danger-soft: #fbe7e4;
  --warn: #b26b00;
  --warn-soft: #fdf0d9;
  --ok: #1e7a4c;
  --ok-soft: #e1f3e8;
  --side: #1f2933;
  --side-2: #2c3a47;
  --side-ink: #e6eaee;
  --side-muted: #9aa8b5;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05);
  --radius: 8px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: var(--font);      /* keine Zierschrift – Überschriften in Inter */
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #12171c; --paper-2: #1a2128; --card: #182027; --ink: #e6eaee; --ink-2: #bcc6cf;
    --muted: #8795a3; --line: #27313b; --line-2: #34404c; --accent: #3bb3c3; --accent-ink: #071a1e;
    --accent-soft: #12333a; --brass: #3bb3c3; --brass-soft: #12333a; --brass-ink: #071a1e; --danger: #ec7a6c;
    --danger-soft: #3a1f1c; --warn: #e9a83d; --warn-soft: #382a14; --ok: #5cc48c; --ok-soft: #173024;
    --side: #0d1216; --side-2: #1a2229; --shadow: 0 1px 2px rgba(0,0,0,.35);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #12171c; --paper-2: #1a2128; --card: #182027; --ink: #e6eaee; --ink-2: #bcc6cf;
  --muted: #8795a3; --line: #27313b; --line-2: #34404c; --accent: #3bb3c3; --accent-ink: #071a1e;
  --accent-soft: #12333a; --brass: #3bb3c3; --brass-soft: #12333a; --brass-ink: #071a1e; --danger: #ec7a6c;
  --danger-soft: #3a1f1c; --warn: #e9a83d; --warn-soft: #382a14; --ok: #5cc48c; --ok-soft: #173024;
  --side: #0d1216; --side-2: #1a2229; --shadow: 0 1px 2px rgba(0,0,0,.35);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  font-family: var(--font); font-size: 14.5px; line-height: 1.5; color: var(--ink);
  background: var(--paper); -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: var(--font); font-weight: 650; letter-spacing: -.015em; margin: 0; line-height: 1.25; }
h1 { font-size: 24px; }
h2 { font-size: 16px; }
h3 { font-size: 14.5px; }
p { margin: 0 0 .6em; }
small, .muted { color: var(--muted); }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }
code, .mono { font-family: ui-monospace, "SF Mono", Consolas, monospace; font-size: .92em; }

/* ------------------------------------------------------------ Layout */
.app { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; background: linear-gradient(90deg, var(--side) 236px, transparent 236px); }
.sidebar {
  background: var(--side); color: var(--side-ink); padding: 22px 14px; position: sticky; top: 0;
  height: 100vh; height: 100dvh; display: flex; flex-direction: column; gap: 6px; overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 22px; color: var(--side-ink); }
.brand:hover { text-decoration: none; }
.brand-mark { width: 32px; height: 32px; border-radius: 7px; background: var(--brass); display: grid; place-items: center; color: var(--brass-ink, #1b1407); }
.brand-mark svg { width: 20px; height: 20px; stroke-width: 2; }
.brand-name { font-family: var(--font); font-size: 15px; font-weight: 700; letter-spacing: -.01em; line-height: 1.22; hyphens: auto;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: break-word; min-width: 0; }
.auth-mobile-name { display: none; font-family: var(--serif); font-size: 22px; font-weight: 600; line-height: 1.2; margin-bottom: 26px; color: var(--ink); hyphens: auto; }
.brand-sub { font-size: 11px; color: var(--side-muted); letter-spacing: .04em; margin-top: -2px; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-label { font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: var(--side-muted); padding: 14px 12px 6px; }
.nav a {
  display: flex; align-items: center; gap: 11px; padding: 8px 12px; border-radius: 6px; color: var(--side-ink);
  font-weight: 500; font-size: 14px; opacity: .82;
}
.nav a:hover { background: var(--side-2); text-decoration: none; opacity: 1; }
.nav a.active { background: var(--side-2); opacity: 1; box-shadow: inset 3px 0 0 var(--accent); }
.nav .count { margin-left: auto; background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 99px; }
.side-version { display: block; margin-top: auto; padding: 10px 12px 8px; font-size: 11px; letter-spacing: .06em; color: var(--side-muted); opacity: .75; text-decoration: none; }
.side-version:hover { opacity: 1; text-decoration: underline; }
.legal-links { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; }
.legal-links a { color: var(--muted); text-decoration: none; }
.legal-links a:hover { text-decoration: underline; color: var(--ink); }
.auth-legal { justify-content: center; margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--line); }
.side-legal { margin-top: auto; padding: 10px 12px 0; }
.side-legal a { color: var(--side-muted); }
.side-legal a:hover { color: var(--side-ink, #fff); }
.side-legal + .side-version { margin-top: 0; }
.side-foot { padding: 14px 10px 0; border-top: 1px solid rgba(255,255,255,.08); display: flex; align-items: center; gap: 10px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; }
.sidebar .avatar { background: var(--side-2); color: var(--side-ink); }
.side-foot .who { flex: 1; min-width: 0; font-size: 13px; line-height: 1.3; }
.side-foot .who b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--side-ink); }
.side-foot .who span { color: var(--side-muted); font-size: 12px; }
.icon-btn { background: transparent; border: 0; color: inherit; padding: 7px; border-radius: 8px; cursor: pointer; display: inline-grid; place-items: center; }
.icon-btn:hover { background: rgba(127,127,127,.15); }
.sidebar .icon-btn { color: var(--side-muted); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 14px; padding: 12px 28px; border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--card) 92%, transparent); backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 20;
}
.search { flex: 1; max-width: 560px; position: relative; }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search input { width: 100%; padding-left: 38px !important; background: var(--card); }
.menu-btn { display: none; }
.content { padding: 24px 28px 60px; max-width: 1440px; width: 100%; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head p { margin: 6px 0 0; color: var(--muted); }
.eyebrow { font-size: 11.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 600; margin-bottom: 4px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ------------------------------------------------------------ Bausteine */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 18px 20px; }
.card-head { display: flex; justify-content: space-between; align-items: center; padding: 13px 18px; border-bottom: 1px solid var(--line); gap: 12px; }
.card-body { padding: 16px 18px; }
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.split { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.stack > * + * { margin-top: 18px; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { padding: 14px 16px; border-top: 3px solid var(--line-2); display: block; color: inherit; }
a.stat:hover { text-decoration: none; border-color: var(--line-2); border-top-color: var(--accent); }
.stat .label { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 7px; text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.stat .value { font-size: 28px; font-weight: 700; line-height: 1.1; margin-top: 8px; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.stat .sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.stat.alert { border-top-color: var(--danger); }
.stat.alert .value { color: var(--danger); }
.stat.ok { border-top-color: var(--ok); }
.stat.accent { border-top-color: var(--accent); }

.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 6px; border: 1px solid var(--line-2);
  background: var(--card); color: var(--ink); font: 600 13.5px var(--font); cursor: pointer; white-space: nowrap; transition: .15s;
}
.btn:hover { text-decoration: none; border-color: var(--ink-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.brass { background: var(--brass); border-color: var(--brass); color: var(--brass-ink, #1b1407); }
.btn.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, var(--line)); }
.btn.danger:hover { background: var(--danger-soft); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--paper-2); }
.btn.sm { padding: 5px 10px; font-size: 12.5px; border-radius: 6px; }
.btn.lg { padding: 10px 18px; font-size: 14px; }
.btn.block { width: 100%; justify-content: center; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 4px; background: var(--paper-2); color: var(--ink-2); white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.accent { background: var(--accent-soft); color: var(--accent); }
.badge.brass { background: var(--brass-soft); color: var(--brass); }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; }

/* ------------------------------------------------------------ Formulare */
label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
input[type=text], input[type=search], input[type=password], input[type=email], input[type=number], input[type=date],
input[type=url], select, textarea {
  width: 100%; padding: 8px 11px; border: 1px solid var(--line-2); border-radius: 6px; background: var(--card);
  color: var(--ink); font: 14px var(--font); transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.field { margin-bottom: 16px; }
.field .hint { font-size: 12.5px; color: var(--muted); margin-top: 5px; }
.form-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0 16px; }
.span-2 { grid-column: span 2; } .span-3 { grid-column: span 3; } .span-4 { grid-column: span 4; } .span-6 { grid-column: span 6; }
.check { display: flex; align-items: flex-start; gap: 10px; font-weight: 500; color: var(--ink); font-size: 14.5px; margin-bottom: 12px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); margin-top: 2px; flex: none; }
.check small { display: block; font-weight: 400; }
.input-group { display: flex; gap: 8px; }
.input-group input { flex: 1; }
.code-input { font-family: ui-monospace, Consolas, monospace !important; letter-spacing: .06em; font-size: 17px !important; }
fieldset { border: 0; padding: 0; margin: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border: 1px solid var(--line-2); border-radius: 99px; cursor: pointer; font-size: 14px; font-weight: 500; color: var(--ink); margin: 0; }
.chip input { accent-color: var(--accent); }
.chip:has(input:checked) { background: var(--accent-soft); border-color: var(--accent); }

/* ------------------------------------------------------------ Meldungen */
.flashes { position: fixed; right: 22px; top: 18px; z-index: 100; display: flex; flex-direction: column; gap: 10px; max-width: 420px; }
.flash { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 6px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); font-size: 14px; animation: slidein .25s ease; }
.flash.success { border-left: 4px solid var(--ok); }
.flash.error { border-left: 4px solid var(--danger); }
.flash.warning { border-left: 4px solid var(--warn); }
.flash.info { border-left: 4px solid var(--accent); }
.flash button { margin-left: auto; }
@keyframes slidein { from { transform: translateY(-8px); opacity: 0; } }
.notice { padding: 12px 14px; border-radius: 6px; background: var(--paper-2); font-size: 14px; display: flex; gap: 10px; align-items: flex-start; }
.notice.warn { background: var(--warn-soft); }
.notice.danger { background: var(--danger-soft); }
.notice.ok { background: var(--ok-soft); }
.notice.accent { background: var(--accent-soft); }

/* ------------------------------------------------------------ Tabellen */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; font-variant-numeric: tabular-nums; }
th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 600; padding: 9px 14px; border-bottom: 1px solid var(--line); background: var(--paper); white-space: nowrap; }
th a { color: inherit; }
td { padding: 8px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
td.num, th.num { text-align: right; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: color-mix(in srgb, var(--paper-2) 50%, transparent); }
td.actions-cell { text-align: right; white-space: nowrap; }
.cell-asset { display: flex; align-items: center; gap: 10px; min-width: 220px; }
.cell-asset .mini-thumb { width: 30px; flex: none; }
.cell-asset b { display: block; font-weight: 600; }
.cell-user { display: flex; align-items: center; gap: 10px; }
.empty { text-align: center; color: var(--muted); padding: 40px 20px; }
.empty svg { width: 38px; height: 38px; color: var(--line-2); margin-bottom: 10px; }

/* ------------------------------------------------------------ Gegenstände */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 18px; }
.toolbar select, .toolbar input { width: auto; min-width: 140px; padding: 7px 10px; font-size: 13.5px; }
.toolbar .grow { flex: 1; min-width: 220px; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 6px; overflow: hidden; background: var(--card); }
.seg a, .seg button { padding: 7px 12px; color: var(--ink-2); font-size: 14px; font-weight: 600; border: 0; background: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.seg a + a, .seg button + button { border-left: 1px solid var(--line-2); }
.seg .on { background: var(--accent-soft); color: var(--accent); }
.seg a:hover { text-decoration: none; background: var(--paper-2); }

.assets-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 26px 22px; }
.assets-grid.compact { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 22px 18px; }
.asset-card { color: var(--ink); display: flex; flex-direction: column; gap: 10px; }
.asset-card:hover { text-decoration: none; }
.asset-card:hover .thumb { transform: translateY(-3px); box-shadow: 0 14px 28px -12px rgba(10, 20, 30, .4); }
.asset-card .t { font-weight: 600; font-size: 14.5px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.asset-card .a { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.asset-card .meta { display: flex; gap: 6px; flex-wrap: wrap; }

.thumb {
  aspect-ratio: 1 / 1; border-radius: 6px; overflow: hidden; position: relative; background: var(--paper-2);
  box-shadow: inset 0 0 0 1px var(--line); transition: transform .2s, box-shadow .2s;
}
.thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; background: var(--paper-2); }
.thumb .ph {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  background: var(--paper-2); color: var(--accent); padding: 10%; text-align: center;
}
.thumb .ph svg { width: 34%; height: 34%; stroke-width: 1.4; opacity: .85; }
.thumb .ph span { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; opacity: .8; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-thumb .thumb { border-radius: 8px; }
.mini-thumb .thumb .ph span { display: none; }
.mini-thumb .thumb .ph svg { width: 55%; height: 55%; }
.secret-box { font-family: ui-monospace, Consolas, monospace; font-size: 15px; letter-spacing: .03em; white-space: pre-wrap; word-break: break-all;
  background: var(--paper-2); border: 1px dashed var(--line); border-radius: 10px; padding: 12px 14px; margin: 10px 0; user-select: all; }

.asset-hero { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 36px; align-items: start; }
.asset-hero h1 { font-size: 26px; }
.asset-hero .sub { font-size: 15px; color: var(--muted); margin-top: 4px; }
.asset-hero .by { margin-top: 12px; font-size: 16px; }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px 22px; margin: 22px 0; padding: 18px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.facts dt { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.facts dd { margin: 2px 0 0; font-weight: 500; }
.desc { color: var(--ink-2); max-width: 70ch; white-space: pre-line; }
.avail { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: 6px; background: var(--paper); border: 1px solid var(--line); margin-bottom: 16px; }
.avail .num { font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; }

.list-row { display: flex; align-items: center; gap: 14px; padding: 12px 22px; border-bottom: 1px solid var(--line); }
.list-row:last-child { border-bottom: 0; }
.list-row .mini-thumb { width: 38px; flex: none; }
.list-row .grow { flex: 1; min-width: 0; }
.list-row .grow b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

dialog { border: 0; border-radius: 18px; padding: 0; background: var(--card); color: var(--ink); width: min(560px, 94vw); box-shadow: 0 30px 60px -20px rgba(0,0,0,.5); }
dialog::backdrop { background: rgba(10, 14, 12, .55); backdrop-filter: blur(3px); }
.dialog-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.dialog-body { padding: 18px 20px; }
.spinner { width: 18px; height: 18px; border: 2px solid var(--line-2); border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; vertical-align: -4px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------ Auth */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(380px, .9fr); }
.auth-art {
  background:
    radial-gradient(circle at 20% 15%, color-mix(in srgb, var(--brass) 35%, transparent), transparent 45%),
    linear-gradient(160deg, var(--auth-a, #25313d), var(--auth-b, #11181f));
  color: #e6eaee; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden;
}
.auth-art.has-bg {
  background:
    linear-gradient(180deg, rgba(8, 12, 10, calc(var(--auth-dim, .45) + .15)) 0%, rgba(8, 12, 10, var(--auth-dim, .45)) 45%, rgba(8, 12, 10, calc(var(--auth-dim, .45) + .1)) 100%),
    var(--auth-bg) center / cover no-repeat;
}
.auth-art > * { position: relative; }
.auth-eyebrow { color: var(--auth-eyebrow, #5cc6d4); }
.auth-library { font-family: var(--serif); font-size: 20px; color: #e6eaee !important; }
.auth-library.big { font-size: 34px; font-weight: 600; line-height: 1.15; margin: 4px 0 10px; color: #ffffff !important; }
.auth-logo { margin-bottom: 26px; display: inline-block; }
.auth-logo img { display: block; max-height: 96px; max-width: min(360px, 100%); }
.auth-logo.plate, .auth-mobile-logo.plate, .brand-logo.plate { background: #fff; padding: 12px 16px; border-radius: 14px; box-shadow: 0 8px 24px -12px rgba(0,0,0,.5); }
.auth-mobile-logo { display: none; margin-bottom: 22px; }
.auth-mobile-logo img { display: block; max-height: 64px; max-width: 240px; }
.brand-logo { display: flex; align-items: center; flex: none; max-width: 100%; }
.brand-logo img { display: block; max-height: 38px; max-width: 120px; }
.brand-logo.solo img { max-height: 54px; max-width: 210px; }
.brand-logo.plate { padding: 6px 10px; border-radius: 10px; }
.auth-art .shelf { display: flex; align-items: flex-end; gap: 5px; height: 220px; margin-top: 40px; }
.auth-art .spine { border-radius: 3px 3px 0 0; width: 26px; box-shadow: inset -4px 0 0 rgba(0,0,0,.18), inset 0 10px 0 rgba(255,255,255,.08); }
.auth-art .shelf-board { height: 10px; background: var(--brass); border-radius: 2px; box-shadow: 0 8px 18px rgba(0,0,0,.4); }
.auth-art h1 { font-size: clamp(30px, 3.4vw, 44px); letter-spacing: -.005em; line-height: 1.12; color: #ffffff; overflow-wrap: anywhere; max-width: 14em; margin-bottom: 12px; }
.auth-art p { color: #b4c0cb; max-width: 46ch; font-size: 16px; }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 40px 28px; }
.auth-form .box { width: 100%; max-width: 380px; }
.auth-form h2 { font-size: 28px; margin-bottom: 6px; }

/* ------------------------------------------------------------ Diverses */
.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 30px; }
.pagination a, .pagination span { min-width: 38px; text-align: center; padding: 7px 10px; border-radius: 9px; border: 1px solid var(--line-2); color: var(--ink-2); font-weight: 600; font-size: 14px; }
.pagination .cur { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.pagination a:hover { text-decoration: none; background: var(--paper-2); }
.btn.primary .kbd { background: transparent; color: inherit; border-color: rgba(255,255,255,.45); }
.kbd { font-family: ui-monospace, monospace; font-size: 12px; border: 1px solid var(--line-2); border-bottom-width: 2px; padding: 1px 6px; border-radius: 6px; background: var(--card); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs a { padding: 10px 16px; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: inline-flex; gap: 7px; align-items: center; }
.tabs a.on { color: var(--ink); border-color: var(--brass); }
.tabs a:hover { text-decoration: none; color: var(--ink); }
.section-title { display: flex; align-items: center; gap: 10px; margin: 6px 0 14px; }
.rule-box { font-family: ui-monospace, Consolas, monospace; font-size: 13px; min-height: 92px; }
.kv { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 8px 16px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-word; }
.swatch-input { width: 48px; height: 40px; padding: 2px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--card); }
.hide { display: none !important; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.mt-0 { margin-top: 0 !important; }
hr { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }

/* ------------------------------------------------------------ Responsiv */
@media (max-width: 1080px) {
  .split, .grid-3 { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; background: none; }
  /* Höhe über top/bottom statt 100vh: 100vh ist auf Handys höher als der sichtbare Bereich
     (Adressleiste) – dadurch lag der Abmelde-Bereich unten außerhalb des Bildschirms. */
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; height: auto; max-height: 100dvh; width: 264px; z-index: 50;
    transform: translateX(-100%); transition: transform .2s; padding-bottom: calc(14px + env(safe-area-inset-bottom)); }

  body.nav-open .sidebar { transform: none; box-shadow: 0 0 0 999px rgba(0,0,0,.45); }
  .menu-btn { display: inline-grid; }
  .topbar { padding: 12px 16px; }
  .content { padding: 20px 16px 50px; }
  .grid-2 { grid-template-columns: 1fr; }
  .asset-hero { grid-template-columns: 1fr; gap: 22px; }
  .asset-hero .thumb-col { max-width: 200px; }
  .assets-grid { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 20px 14px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid > * { grid-column: auto !important; }
  .auth { grid-template-columns: 1fr; }
  .auth-art { display: none; }
  .auth-mobile-logo { display: inline-block; }
  .auth-mobile-name { display: block; }
  h1 { font-size: 25px; }
  .kv { grid-template-columns: 1fr; }
  .flashes { left: 16px; right: 16px; max-width: none; }
}
@media print {
  .sidebar, .topbar, .actions, .btn { display: none !important; }
  .app { display: block; }
}
.list-row .grow small { display: block; overflow-wrap: anywhere; }

/* ------------------------------------------------------------ Benutzermenü (Handy) */
.user-menu { display: none; position: relative; margin-left: auto; }
.user-menu summary { list-style: none; cursor: pointer; }
.user-menu summary::-webkit-details-marker { display: none; }
.user-menu .avatar { width: 38px; height: 38px; }
.user-menu .menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 230px; background: var(--card);
  border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; z-index: 60; }
.user-menu .menu .who { padding: 10px 12px 8px; border-bottom: 1px solid var(--line); margin-bottom: 4px; font-size: 13px; }
.user-menu .menu .who b { display: block; font-size: 14px; }
.user-menu .menu a, .user-menu .menu button { display: flex; width: 100%; align-items: center; gap: 10px; padding: 11px 12px;
  border: 0; background: none; border-radius: 8px; color: var(--ink); font: 500 15px var(--font); cursor: pointer; text-align: left; }
.user-menu .menu a:hover, .user-menu .menu button:hover { background: var(--paper-2); text-decoration: none; }
.user-menu .menu .logout { color: var(--danger); }
@media (max-width: 860px) {
  .user-menu { display: block; }
  .topbar .btn.primary.sm span { display: none; }
}

/* ------------------------------------------------------------ Erscheinungsbild (Admin) */
.logo-previews { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.logo-swatch { height: 96px; border-radius: 12px; display: grid; place-items: center; padding: 12px; border: 1px solid var(--line); }
.logo-swatch.side { background: var(--side); }
.logo-swatch.light { background: #ffffff; }
.logo-swatch img { max-height: 64px; max-width: 100%; }
.color-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.color-row:last-child { border-bottom: 0; }
.color-row input[type=color] { width: 46px; height: 40px; padding: 2px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--card); cursor: pointer; flex: none; }
.color-row .grow { flex: 1; min-width: 0; }
.color-row .grow b, .color-row .grow small { display: block; }
.color-row code { font-size: 12.5px; color: var(--muted); min-width: 64px; }
.login-preview {
  position: relative; border-radius: 14px; overflow: hidden; aspect-ratio: 16 / 10; padding: 22px 46% 22px 22px;
  display: flex; flex-direction: column; justify-content: space-between; color: #e6eaee;
  background:
    radial-gradient(circle at 20% 15%, color-mix(in srgb, var(--brass) 35%, transparent), transparent 45%),
    linear-gradient(160deg, var(--auth-a, #25313d), var(--auth-b, #11181f));
}
.login-preview.has-bg {
  background:
    linear-gradient(180deg, rgba(8, 12, 10, calc(var(--auth-dim, .45) + .15)), rgba(8, 12, 10, var(--auth-dim, .45)) 45%, rgba(8, 12, 10, calc(var(--auth-dim, .45) + .1))),
    var(--auth-bg) center / cover no-repeat;
}
.login-preview .auth-logo { margin-bottom: 10px; }
.login-preview .auth-logo img { max-height: 36px; max-width: 150px; }
.login-preview .auth-logo.plate { padding: 5px 8px; border-radius: 8px; }
.login-preview .eyebrow { font-size: 9px; margin-bottom: 2px; }
.lp-title { font-family: var(--serif); font-size: 19px; font-weight: 600; line-height: 1.15; color: #ffffff; }
.lp-lib { font-family: var(--serif); font-size: 12px; }
.lp-text { font-size: 10.5px; color: #b4c0cb; margin-top: 4px; }
.lp-shelf { display: flex; gap: 3px; align-items: flex-end; border-bottom: 5px solid var(--brass); width: max-content; }
.lp-shelf i { width: 12px; border-radius: 2px 2px 0 0; display: block; }
.lp-form { position: absolute; right: 0; top: 0; bottom: 0; width: 40%; background: var(--paper); display: flex; flex-direction: column;
  justify-content: center; gap: 8px; padding: 0 9%; }
.lp-form span { height: 12px; border: 1px solid var(--line-2); border-radius: 4px; background: var(--card); }
.lp-form b { height: 14px; border-radius: 4px; background: var(--accent); margin-top: 4px; }

/* ------------------------------------------------------------ Sprache und Hilfe */
.lang-switch { display: inline-flex; border: 1px solid var(--line-2); border-radius: 999px; padding: 2px; gap: 2px; background: var(--card); }
.lang-switch button { border: 0; background: none; color: var(--muted); font: 600 12px var(--font); letter-spacing: .04em;
  padding: 4px 9px; border-radius: 999px; cursor: pointer; }
.lang-switch button:hover { color: var(--ink); }
.lang-switch button.on { background: var(--ink); color: var(--card); }
.topbar .lang-switch { flex: none; }
.auth-form .lang-switch { display: flex; width: max-content; margin: 0 0 18px auto; }
.user-menu .menu .lang-switch { margin: 6px 12px 8px; }
.topbar .help-btn { flex: none; }
@media (max-width: 860px) { .topbar > .lang-switch { display: none; } }
.help-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 28px; align-items: start; }
.help-toc { position: sticky; top: 84px; font-size: 14px; }
.help-toc .nav-group { margin-bottom: 14px; }
.help-toc .nav-group b { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 6px; }
.help-toc a { display: block; padding: 4px 8px; border-radius: 8px; color: var(--ink); text-decoration: none; }
.help-toc a:hover, .help-toc a.on { background: var(--paper-2); }
.help-topic { scroll-margin-top: 84px; }
.help-topic.focus { outline: 2px solid var(--accent); outline-offset: 4px; }
.help-topic h2 { display: flex; align-items: center; gap: 10px; }
.help-topic .role-tag { font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted);
  border: 1px solid var(--line-2); border-radius: 999px; padding: 2px 8px; }
.help-topic ol, .help-topic ul { padding-left: 20px; }
.help-topic li { margin: 4px 0; }
.help-topic .ui { font-weight: 600; }
.help-search { margin-bottom: 18px; }
.help-empty { display: none; }
@media (max-width: 860px) { .help-layout { grid-template-columns: 1fr; } .help-toc { position: static; } }
.help-topic pre { background: var(--paper-2); border-radius: 10px; padding: 12px 14px; overflow-x: auto; font-size: 13px; line-height: 1.5; }
.help-topic pre code { background: none; padding: 0; }
.help-topic code { font-size: .92em; }

/* ------------------------------------------------------------ Regal mit Kisten (Anmeldeseite) */
.auth-art .spine.box { position: relative; border-radius: 6px 6px 2px 2px; box-shadow: inset 0 -8px 0 rgba(0,0,0,.16), inset 0 8px 0 rgba(255,255,255,.07); }
.auth-art .spine.box::after { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 18%; transform: translateX(-50%); background: rgba(255,255,255,.14); }
.auth-art .shelf { gap: 8px; }
.lp-shelf i { border-radius: 3px 3px 1px 1px; }
.code-input::placeholder { font-family: var(--font); letter-spacing: 0; font-size: 15px; }
textarea.code-input { font-size: 15px !important; }

/* ------------------------------------------------------------ Kennzahlen und Auslastung */
.meter { height: 8px; border-radius: 4px; background: var(--paper-2); overflow: hidden; min-width: 80px; }
.meter span { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.nowrap { white-space: nowrap; }
td small.mono { color: var(--muted); }
.assets-table td.holder { color: var(--ink-2); }
.assets-table td.thumb-cell { width: 44px; padding-right: 0; }

/* ------------------------------------------------------------ Vorschläge beim Tippen */
.suggest-host { position: relative; }
.suggest-box {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 40; max-height: 420px; overflow-y: auto;
  background: var(--card); border: 1px solid var(--line-2); border-radius: 8px;
  box-shadow: 0 10px 28px rgba(16, 24, 40, .16); padding: 4px;
}
.suggest-box[hidden] { display: none; }
.suggest-item {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 6px;
  background: none; color: var(--ink); font: inherit; text-align: left; cursor: pointer; text-decoration: none;
}
.suggest-item:hover, .suggest-item.on { background: var(--accent-soft); text-decoration: none; }
.suggest-item[aria-disabled="true"] { cursor: not-allowed; opacity: .55; }
.suggest-item .grow { min-width: 0; }
.suggest-item b { display: block; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.suggest-item small { display: block; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.suggest-item small .mono { font-family: var(--mono, ui-monospace, monospace); }
.suggest-note { padding: 8px 10px; color: var(--muted); font-size: 12.5px; }
.suggest-more { display: block; padding: 8px 10px; font-size: 12.5px; font-weight: 600; border-top: 1px solid var(--line); margin-top: 4px; }

/* Nummernprüfung im Formular */
.number-hint { font-size: 12.5px; margin-top: 6px; color: var(--muted); line-height: 1.5; min-height: 0; }
.number-hint .taken { color: var(--danger); font-weight: 600; }
.number-hint .free { color: var(--ok); font-weight: 600; }
.number-hint .mono { font-family: var(--mono, ui-monospace, monospace); }
.number-hint button.linklike { border: 0; background: none; padding: 0; color: var(--accent); font: inherit; font-weight: 600; cursor: pointer; text-decoration: underline; }
input.is-taken { border-color: var(--danger) !important; box-shadow: 0 0 0 3px var(--danger-soft); }
