/* CompTransfer – schlichtes Business-Design.
   Markenfarben kommen aus /brand.css (im Admin-Bereich unter "Branding" änderbar):
   --brand (Hauptfarbe), --brand-ink (Schrift darauf), --brand-text (lesbare Textfarbe),
   --accent (Akzent), --accent-soft / --accent-tint (helle Flächen). */
:root {
  --brand: #494949;
  --brand-ink: #f4d851;
  --brand-text: #494949;
  --accent: #f4d851;
  --accent-soft: #fdf7dc;
  --accent-tint: #fefcf3;
  --bg: #f4f6f9;
  --surface: #ffffff;
  --text: #1c2330;
  --muted: #5d6879;
  --line: #e2e6ed;
  --line-strong: #cfd5df;
  --ok: #1d7a46;
  --ok-bg: #e7f5ed;
  --warn: #9a5b00;
  --warn-bg: #fff4e0;
  --err: #b42318;
  --err-bg: #fdecea;
  --info-bg: #e9f1fb;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
  --font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, "SFMono-Regular", Menlo, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.5 var(--font); color: var(--text); background: var(--bg); min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--brand-text); text-decoration: none; }
a:hover { text-decoration: underline; }
main a:not(.btn):not(.back), .footer a { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 3px; }
main .tabs a:not(.btn):not(.back) { text-decoration: none; }
h1 { font-size: 1.6rem; line-height: 1.25; margin: 0 0 .3rem; font-weight: 650; letter-spacing: -.01em; }
h2 { font-size: 1.05rem; margin: 0 0 .9rem; font-weight: 650; }
p { margin: 0 0 .8rem; }
small, .small { font-size: .85rem; }
.tiny { font-size: .72rem; }
.muted { color: var(--muted); }
.strong { font-weight: 600; }
.mono { font-family: var(--mono); }
.nowrap { white-space: nowrap; }
.wrap { word-break: break-all; }
.center { text-align: center; }
.right { text-align: right; }
.strike { text-decoration: line-through; color: var(--muted); }
[hidden] { display: none !important; }

/* --- Kopfzeile ---------------------------------------------------------------------- */
.topbar { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.topbar-inner { max-width: 1180px; margin: 0 auto; padding: 0 20px; height: 60px; display: flex; align-items: center; gap: 28px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.05rem; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-logo { height: 30px; width: auto; display: block; }
.brand-name { padding-left: 12px; border-left: 1px solid var(--line-strong); color: var(--muted); font-weight: 600; }
.mainnav { display: flex; gap: 4px; height: 100%; }
.mainnav a { white-space: nowrap; display: flex; align-items: center; padding: 0 12px; color: var(--muted); font-weight: 500; border-bottom: 2px solid transparent; }
.mainnav a:hover { color: var(--text); text-decoration: none; }
.mainnav a.active { color: var(--text); border-bottom: 3px solid var(--accent); padding-top: 3px; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.whoami { color: var(--muted); font-size: .9rem; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.langswitch { display: flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.langswitch a { padding: 2px 8px; font-size: .78rem; color: var(--muted); font-weight: 600; }
.langswitch a.active { background: var(--brand); color: var(--brand-ink); }
.langswitch a:hover { text-decoration: none; }
.inline { display: inline; margin: 0; }

/* --- Layout ------------------------------------------------------------------------- */
main { flex: 1; width: 100%; }
.app-main { max-width: 1180px; margin: 0 auto; padding: 28px 20px 48px; }
.public-main { max-width: 760px; margin: 0 auto; padding: 48px 16px; }
.footer { text-align: center; color: var(--muted); font-size: .8rem; padding: 18px; }
.page-head { margin-bottom: 20px; }
.page-head.row, .row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.back { display: inline-block; font-size: .88rem; margin-bottom: 6px; }
.stack { display: flex; flex-direction: column; gap: 18px; }
.stack-sm { display: flex; flex-direction: column; gap: 12px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; align-items: start; }
.detail-grid aside .grid-2 { grid-template-columns: 1fr; }
.actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.actions.center { justify-content: center; margin: 22px 0 6px; }

/* --- Karten ------------------------------------------------------------------------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.card.flush { padding: 0; overflow-x: auto; }
.card.narrow { max-width: 440px; margin: 0 auto; }
.card.narrow-wide { max-width: 680px; margin: 0 auto; padding: 30px; }
.card.empty { text-align: center; padding: 40px; color: var(--muted); }
.card.danger-zone form + form { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.eyebrow { text-transform: uppercase; letter-spacing: .06em; font-size: .75rem; font-weight: 700; color: var(--muted); margin-bottom: 4px; }
blockquote.message { margin: 14px 0 18px; padding: 12px 16px; background: var(--bg); border-left: 3px solid var(--accent); border-radius: 0 8px 8px 0; white-space: pre-line; }

/* --- Formulare ---------------------------------------------------------------------- */
.field { display: flex; flex-direction: column; gap: 5px; margin: 0; min-width: 0; border: 0; padding: 0; }
.field > span, .field > legend { font-weight: 600; font-size: .88rem; padding: 0; }
.field legend { margin-bottom: 6px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=search], select, textarea {
  font: inherit; color: inherit; background: #fff; border: 1px solid var(--line-strong); border-radius: 7px; padding: 8px 11px; width: 100%; min-height: 38px;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); border-color: var(--brand); }
input[readonly] { background: var(--bg); }
.check, .radio { display: flex; align-items: center; gap: 8px; font-weight: 400; font-size: .92rem; cursor: pointer; }
.check input, .radio input { width: 16px; height: 16px; accent-color: var(--brand); margin: 0; }
.radio + .radio { margin-top: 4px; }
.hint { color: var(--muted); font-size: .8rem; font-weight: 400; margin: 0; }
.presets { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 2px; }
.chip { font: inherit; font-size: .78rem; padding: 2px 9px; border-radius: 99px; border: 1px solid var(--line-strong); background: #fff; cursor: pointer; color: var(--muted); }
.chip:hover { border-color: var(--brand); color: var(--brand-text); background: var(--accent-tint); }
details.options { margin-top: 16px; border: 1px solid var(--line); border-radius: 8px; padding: 0 14px; }
details.options[open] { padding-bottom: 14px; }
details.options > summary { cursor: pointer; font-weight: 600; padding: 11px 0; font-size: .92rem; }
details.options > .grid-2, details.options > .field { margin-top: 6px; }
details.options > .field { margin-top: 14px; }
.form-error { background: var(--err-bg); color: var(--err); border-radius: 8px; padding: 10px 14px; }
input.otp { font-family: var(--mono); font-size: 1.5rem; letter-spacing: .4em; text-align: center; }
.inline-form { display: flex; align-items: center; gap: 10px; }
.inline-form input[type=text] { width: 90px; }
.filterbar { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.filterbar select, .filterbar input { width: auto; min-width: 200px; }

/* --- Buttons ------------------------------------------------------------------------ */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-weight: 600; font-size: .9rem; padding: 8px 15px; border-radius: 7px; border: 1px solid var(--line-strong); background: #fff; color: var(--text); cursor: pointer; white-space: nowrap; min-height: 38px; }
.btn:hover { text-decoration: none; border-color: var(--muted); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn-primary:hover { filter: brightness(1.12); border-color: var(--brand); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--bg); border-color: transparent; color: var(--text); }
.btn-warn { color: var(--warn); border-color: #e9c27a; background: var(--warn-bg); }
.btn-danger { color: #fff; background: var(--err); border-color: var(--err); }
.btn-sm { padding: 4px 10px; font-size: .82rem; min-height: 30px; }
.btn-lg { padding: 11px 22px; font-size: 1rem; }
.btn-block { width: 100%; }
.btn.copied { background: var(--ok); border-color: var(--ok); color: #fff; }
.linkish { color: var(--brand-text); font-weight: 600; text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 3px; }

/* --- Meldungen & Badges ------------------------------------------------------------- */
.flash { border-radius: 8px; padding: 11px 15px; margin-bottom: 18px; font-size: .93rem; }
.flash-ok { background: var(--ok-bg); color: var(--ok); }
.flash-error { background: var(--err-bg); color: var(--err); }
.flash-info { background: var(--accent-soft); color: var(--text); }
.badge { display: inline-block; font-size: .72rem; font-weight: 700; padding: 2px 8px; border-radius: 99px; vertical-align: middle; letter-spacing: .01em; background: var(--bg); color: var(--muted); }
h1 .badge { font-size: .75rem; margin-left: 6px; }
.badge-active { background: var(--ok-bg); color: var(--ok); }
.badge-scanning { background: var(--accent-soft); color: var(--text); }
.badge-expired, .badge-exhausted { background: var(--warn-bg); color: var(--warn); }
.badge-blocked { background: var(--err-bg); color: var(--err); }

/* --- Tabellen & Listen -------------------------------------------------------------- */
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 650; padding: 10px 16px; border-bottom: 1px solid var(--line); background: #fafbfc; }
.table td { padding: 11px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table.compact td, .table.compact th { padding: 7px 10px; }
.card > .table.compact { margin: 0 -10px; width: calc(100% + 20px); }
.card.flush > .table.compact { margin: 0; width: 100%; }
.card.flush > .table.compact td:first-child, .card.flush > .table.compact th:first-child { padding-left: 16px; }
.table td form { display: inline; }
.plainlist { list-style: none; margin: 0; padding: 0; }
.filerow { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.filerow:last-child { border-bottom: 0; }
.filerow > div { min-width: 0; word-break: break-word; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.tabs a { padding: 8px 14px; color: var(--muted); font-weight: 600; font-size: .9rem; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a.active { color: var(--text); border-bottom: 3px solid var(--accent); }
.tabs a:hover { text-decoration: none; color: var(--text); }
.pager { display: flex; gap: 12px; align-items: center; justify-content: center; margin-top: 14px; }
.facts { list-style: none; margin: 0 0 12px; padding: 0; }
.facts li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px dashed var(--line); font-size: .9rem; }
.facts li:last-child { border-bottom: 0; }
.facts span { color: var(--muted); }
.inline-facts { display: flex; justify-content: center; gap: 28px; margin-top: 18px; }
.inline-facts li { flex-direction: column; align-items: center; border: 0; gap: 0; }

/* --- Quota ------------------------------------------------------------------------- */
.quota { margin-top: 6px; width: 260px; }
.quota-bar { height: 6px; background: var(--line); border-radius: 99px; overflow: hidden; margin-bottom: 2px; }
.quota-bar span { display: block; height: 100%; background: var(--brand); width: 0; }

/* --- Upload ------------------------------------------------------------------------ */
.dropzone { border: 2px dashed var(--line-strong); border-radius: var(--radius); padding: 34px 20px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 4px; cursor: pointer; transition: background .15s, border-color .15s; background: #fbfcfd; }
.dropzone:hover, .dropzone:focus, .dropzone.drag { border-color: var(--accent); background: var(--accent-tint); outline: none; }
.dz-icon { width: 38px; height: 38px; color: var(--brand-text); margin-bottom: 4px; }
.filelist { list-style: none; padding: 0; margin: 14px 0 0; display: flex; flex-direction: column; gap: 8px; }
.fileitem { position: relative; border: 1px solid var(--line); border-radius: 8px; padding: 9px 40px 10px 12px; background: #fff; }
.fileitem.has-error { border-color: #f1b8b2; background: var(--err-bg); }
.fi-name { font-weight: 600; font-size: .92rem; word-break: break-all; }
.fi-meta { font-size: .8rem; color: var(--muted); }
.has-error .fi-meta, .st-failed .fi-meta { color: var(--err); }
.fi-bar { height: 4px; background: var(--line); border-radius: 99px; margin-top: 6px; overflow: hidden; }
.fi-bar span { display: block; height: 100%; background: var(--brand); width: 0; transition: width .2s; }
.st-done .fi-bar span { background: var(--ok); }
.has-error .fi-bar { display: none; }
.fi-remove { position: absolute; right: 8px; top: 8px; border: 0; background: transparent; font-size: 1.3rem; line-height: 1; color: var(--muted); cursor: pointer; width: 26px; height: 26px; border-radius: 6px; }
.fi-remove:hover { background: var(--bg); color: var(--text); }
.filesum { margin: 10px 0 0; font-size: .88rem; }

/* --- Link-Ergebnis ------------------------------------------------------------------ */
.copyrow { display: flex; gap: 8px; }
.copyrow input { flex: 1; font-size: .88rem; }
.linkmeta { display: flex; gap: 20px; margin-top: 16px; align-items: flex-start; }
.linkmeta .facts { flex: 1; }
.qr { border: 1px solid var(--line); border-radius: 8px; background: #fff; flex: none; }
.result-head { display: flex; gap: 14px; align-items: center; margin-bottom: 16px; }
.result-head h2 { margin: 0; }
.result-head p { margin: 0; }
.ok-icon { width: 40px; height: 40px; color: #fff; background: var(--ok); border-radius: 50%; padding: 8px; flex: none; }
.ok-icon.big { width: 56px; height: 56px; padding: 12px; margin-bottom: 8px; }
.result .actions { margin-top: 16px; }

/* --- Öffentliche Seiten -------------------------------------------------------------- */
.is-public .topbar-inner { max-width: 760px; }
.lockicon { width: 48px; height: 48px; border-radius: 12px; background: var(--brand); color: var(--brand-ink); display: grid; place-items: center; margin-bottom: 14px; }
.lockicon svg { width: 26px; height: 26px; }
.dl-list { list-style: none; padding: 0; margin: 18px 0 0; border: 1px solid var(--line); border-radius: var(--radius); }
.dl-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.dl-list li:last-child { border-bottom: 0; }
.dl-name { display: flex; align-items: center; gap: 12px; min-width: 0; }
.dl-name strong { word-break: break-all; font-weight: 600; }
.fileicon { flex: none; width: 40px; height: 46px; border-radius: 6px; background: var(--accent-soft); color: var(--text); font-size: .62rem; font-weight: 800; display: grid; place-items: end center; padding-bottom: 7px; letter-spacing: .03em; }

/* --- Admin -------------------------------------------------------------------------- */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.stat span { display: block; color: var(--muted); font-size: .8rem; }
.stat strong { font-size: 1.35rem; font-weight: 650; }

/* --- Responsiv ---------------------------------------------------------------------- */
@media (max-width: 1380px) {
  .brand-name { display: none; }
  .whoami { display: none; }
  .topbar-inner { gap: 18px; }
}
@media (max-width: 900px) {
  .detail-grid { grid-template-columns: 1fr; }
  .is-app .topbar-inner { flex-wrap: wrap; height: auto; padding-top: 10px; gap: 8px 12px; }
  .mainnav { order: 3; width: 100%; height: 42px; overflow-x: auto; }
  .mainnav a { white-space: nowrap; }
}
@media (max-width: 640px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .app-main { padding: 18px 16px 40px; }
  .public-main { padding: 24px 16px; }
  .card { padding: 16px; }
  .card.narrow-wide { padding: 20px 16px; }
  .whoami { display: none; }
  .brand-logo { height: 20px; }
  .langswitch a { padding: 2px 6px; }
  .brand-name { display: none; }
  .copyrow { flex-direction: column; }
  .linkmeta { flex-direction: column; }
  .dl-list li { flex-direction: column; align-items: stretch; }
  .table th:nth-child(2), .table td:nth-child(2) { display: none; }
  .quota { width: 100%; }
}

/* --- Admin: Branding --------------------------------------------------------------- */
.colorrow { display: flex; gap: 8px; align-items: center; }
.colorrow input[type=color] { width: 46px; height: 38px; padding: 2px; border: 1px solid var(--line-strong); border-radius: 7px; background: #fff; cursor: pointer; flex: none; }
.colorrow input[type=text] { width: 120px; }
.filepick { display: flex; gap: 18px; align-items: flex-start; }
.logo-current, .favicon-current { flex: none; border: 1px dashed var(--line-strong); border-radius: 8px; padding: 12px; background: #fff; display: grid; place-items: center; min-height: 64px; }
.logo-current { width: 240px; }
.logo-current img { max-width: 100%; max-height: 40px; }
.favicon-current img { width: 48px; height: 48px; object-fit: contain; }
.filepick input[type=file] { font: inherit; font-size: .88rem; }
.brand-preview .pv-bar { display: flex; align-items: center; gap: 14px; border-bottom: 1px solid var(--line); padding-bottom: 10px; margin-bottom: 12px; }
.brand-preview .pv-bar img { height: 26px; width: auto; max-width: 170px; }
.brand-preview .pv-nav { font-weight: 600; font-size: .88rem; border-bottom: 3px solid var(--accent); padding-bottom: 4px; }
.brand-preview .pv-link { color: var(--brand-text); }
.brand-preview .pv-btn { cursor: default; }
.brand-preview .pv-quota { margin-top: 14px; }
.brand-preview .pv-quota span { width: 60%; }
@media (max-width: 640px) { .filepick { flex-direction: column; } .logo-current { width: 100%; } }

/* --- Admin: Sicherheitsstatus ----------------------------------------------------- */
.mt { margin-top: 18px; }
.checklist { list-style: none; padding: 0; margin: 0 0 12px; }
.chk { display: flex; gap: 10px; align-items: flex-start; padding: 7px 0; border-bottom: 1px dashed var(--line); }
.chk:last-child { border-bottom: 0; }
.chk strong { font-size: .9rem; font-weight: 600; }
.chk-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; margin-top: 6px; }
.chk-ok .chk-dot { background: var(--ok); }
.chk-warn .chk-dot { background: #e0a100; }
.chk-fail .chk-dot { background: var(--err); }
.chk-fail strong { color: var(--err); }
.verifyform { display: flex; gap: 10px; align-items: center; margin: -4px 0 14px; flex-wrap: wrap; }
.policy-hint { background: var(--accent-tint); border-left: 3px solid var(--accent); padding: 8px 10px; border-radius: 0 6px 6px 0; margin: 0 0 12px; color: var(--text); }
