/* BHS HQ – HufManagerOS Dark */
@font-face { font-family: Outfit; font-weight: 100 900; font-display: swap; src: url(/outfit-latin-wght.woff2) format("woff2"); }
:root {
  --orange: #E97824; --orange-hover: #D96D1D; --on-orange: #000;
  --canvas: #0A0A0A; --surface: #141414; --raised: #1C1C1C; --line: #262626;
  --text: #F5F5F5; --muted: #A3A3A3; --danger: #F04438; --ok: #32D583;
  --r-ctl: 12px; --r-btn: 16px; --r-card: 18px; --r-panel: 26px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: Outfit, system-ui, sans-serif; background: var(--canvas); color: var(--text); line-height: 1.55; font-size: 1.0625rem; -webkit-font-smoothing: antialiased; touch-action: manipulation; }
a { color: var(--text); text-decoration-color: var(--orange); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 3px; border-radius: 6px; }
h1, h2 { letter-spacing: -.03em; line-height: 1.1; text-wrap: balance; margin: 0 0 .4em; }
h1 { font-size: clamp(2rem, 4vw, 2.8rem); }
h2 { font-size: 1.2rem; }
.mt { margin-top: 24px; }
.small { font-size: .9rem; color: var(--muted); }
.lead { color: var(--muted); font-size: 1.1rem; margin: 0 0 28px; max-width: 60ch; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 22px; border-radius: var(--r-btn); border: 0; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; transition: background-color .2s ease, transform .2s ease; }
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--orange); color: var(--on-orange); }
.btn-primary:hover { background: var(--orange-hover); }
.btn-ghost { background: var(--raised); color: var(--text); }
.btn-ghost:hover { background: #262626; }
.btn-danger { background: rgba(240,68,56,.14); color: #FDA29B; }
.btn-danger:hover { background: rgba(240,68,56,.24); }
.btn-sm { min-height: 40px; padding: 0 16px; border-radius: var(--r-ctl); font-size: .95rem; }

input, select, textarea { font: inherit; width: 100%; min-height: 48px; padding: 10px 14px; background: var(--surface); color: var(--text); border: 1.5px solid var(--line); border-radius: var(--r-ctl); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--orange); }
label { font-weight: 600; font-size: .95rem; }

/* Anmeldung */
body.auth { min-height: 100dvh; display: grid; place-items: center; padding: 20px; }
.auth-card { width: min(420px, 100%); background: var(--surface); border-radius: var(--r-panel); padding: 32px; }
.auth-card .brand { margin-bottom: 26px; }
.stack { display: grid; gap: 10px; margin: 18px 0; }
.stack .btn { margin-top: 8px; }
.note { padding: 12px 14px; border-radius: var(--r-ctl); }
.note.err { background: rgba(240,68,56,.14); color: #FDA29B; }
.note.ok { background: rgba(50,213,131,.12); color: #A6F4C5; }
code { background: var(--raised); padding: 1px 6px; border-radius: 6px; }

/* Kopf */
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.brand span { display: flex; flex-direction: column; line-height: 1.1; }
.brand small { color: var(--muted); font-size: .8125rem; }
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px; justify-content: space-between; padding: 12px 20px; background: var(--canvas); }
.tabs { display: flex; gap: 4px; background: var(--surface); padding: 4px; border-radius: 999px; }
.tabs a { text-decoration: none; padding: 9px 16px; border-radius: 999px; color: var(--muted); font-weight: 600; font-size: .95rem; }
.tabs a[aria-current="page"] { background: var(--orange); color: #000; }
@media (max-width: 640px) {
  .top { flex-wrap: wrap; }
  .tabs { order: 3; width: 100%; justify-content: space-between; }
  .tabs a { flex: 1; text-align: center; padding: 10px 6px; }
}
main { max-width: 1200px; margin: 0 auto; padding: 28px 20px 80px; }

/* Übersicht */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--surface); border-radius: var(--r-card); padding: 20px; display: flex; flex-direction: column; gap: 4px; }
.kpi .v { font-size: 2.4rem; font-weight: 800; letter-spacing: -.04em; font-variant-numeric: tabular-nums; line-height: 1; }
.kpi .l { color: var(--muted); font-size: .9rem; }
.kpi.accent { background: var(--orange); color: #000; }
.kpi.accent .l { color: rgba(0,0,0,.7); }
@media (max-width: 760px) { .kpis { grid-template-columns: 1fr 1fr; } }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 20px; }
@media (max-width: 760px) { .cols { grid-template-columns: 1fr; } }
.panel { background: var(--surface); border-radius: var(--r-panel); padding: 24px; }
.status, .links { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.status li { display: flex; align-items: center; gap: 10px; }
.status li::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--muted); flex: none; }
.status li.ok::before { background: var(--ok); }
.status li.warn::before { background: var(--orange); }
.status li.err::before { background: var(--danger); }
.links a { display: flex; min-height: 48px; align-items: center; padding: 0 16px; background: var(--raised); border-radius: var(--r-ctl); text-decoration: none; font-weight: 600; }
.links a:hover { background: #262626; }
.bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.bars li { position: relative; display: flex; justify-content: space-between; gap: 12px; padding: 10px 12px; background: var(--raised); border-radius: 10px; overflow: hidden; font-size: .95rem; }
.bars li i { position: absolute; inset: 0 auto 0 0; background: rgba(233,120,36,.22); }
.bars li span { position: relative; overflow-wrap: anywhere; }
.bars li b { position: relative; font-variant-numeric: tabular-nums; }

/* Mediathek */
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.drop { background: var(--surface); border: 2px dashed #333; border-radius: var(--r-panel); padding: 22px; margin-bottom: 20px; display: grid; gap: 8px; }
.drop.over { border-color: var(--orange); background: rgba(233,120,36,.06); }
.drop p { margin: 0; }
.drop select { max-width: 360px; }
.progress { height: 8px; background: var(--raised); border-radius: 999px; overflow: hidden; }
.progress span { display: block; height: 100%; width: 0; background: var(--orange); transition: width .2s ease; }
.media-layout { display: grid; grid-template-columns: 260px 1fr; gap: 20px; }
@media (max-width: 860px) { .media-layout { grid-template-columns: 1fr; } }
.cats ul { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 4px; }
@media (max-width: 860px) { .cats ul { display: flex; flex-wrap: wrap; } }
.cats button.cat { width: 100%; display: flex; justify-content: space-between; gap: 8px; min-height: 44px; align-items: center; padding: 0 14px; background: transparent; color: var(--muted); border: 0; border-radius: var(--r-ctl); font: inherit; font-weight: 600; cursor: pointer; text-align: left; }
.cats button.cat:hover { background: var(--surface); color: var(--text); }
.cats button.cat[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: inset 3px 0 0 var(--orange); }
.cats .count { font-variant-numeric: tabular-nums; color: var(--muted); font-weight: 500; }
.cat-add { display: flex; gap: 8px; }
.grid { list-style: none; padding: 0; margin: 14px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.grid button { width: 100%; padding: 0; border: 0; background: var(--surface); border-radius: var(--r-card); overflow: hidden; cursor: pointer; color: var(--text); text-align: left; font: inherit; }
.grid button:hover { background: var(--raised); }
.grid .thumb { aspect-ratio: 1; display: grid; place-items: center; background: #0f0f0f; color: var(--muted); font-weight: 700; letter-spacing: .02em; }
.grid .thumb img { width: 100%; height: 100%; object-fit: cover; }
.grid .cap { padding: 10px 12px; font-size: .9rem; display: flex; gap: 6px; align-items: center; min-width: 0; }
.grid .cap span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grid .web { flex: none; font-size: .75rem; background: var(--orange); color: #000; padding: 1px 7px; border-radius: 999px; font-weight: 700; }
.empty { color: var(--muted); padding: 30px 0; }

/* Detail-Dialog */
dialog { width: min(980px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); padding: 0; border: 0; border-radius: var(--r-panel); background: var(--surface); color: var(--text); overscroll-behavior: contain; }
dialog::backdrop { background: rgba(0,0,0,.7); }
.detail { display: grid; grid-template-columns: 1.2fr 1fr; }
@media (max-width: 760px) { .detail { grid-template-columns: 1fr; } }
.detail-media { background: #000; display: grid; place-items: center; min-height: 280px; }
.detail-media img, .detail-media video { max-width: 100%; max-height: 70dvh; display: block; }
.detail-media .file { color: var(--muted); padding: 40px; text-align: center; }
.detail-form { padding: 24px; display: grid; gap: 8px; align-content: start; overflow: auto; max-height: calc(100dvh - 24px); }
.check { display: flex; gap: 10px; align-items: center; font-weight: 500; margin-top: 6px; }
.check input { width: 22px; min-height: 22px; height: 22px; accent-color: var(--orange); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
