/* Click Upload – Darkmode, angelehnt an das Click-Networks-Logo */
:root {
  --bg: #0b0f14;
  --bg2: #10161e;
  --card: #141b24;
  --card2: #1a2330;
  --line: #243041;
  --text: #e6e8eb;
  --muted: #8b96a5;
  --blue: #0d84dc;
  --blue-h: #2a98ea;
  --blue-soft: rgba(13, 132, 220, .14);
  --green: #2fbf71;
  --red: #e5484d;
  --amber: #f0a020;
  --radius: 14px;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(13, 132, 220, .18), transparent 60%),
    radial-gradient(900px 500px at 110% 110%, rgba(13, 132, 220, .10), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--blue-h); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.45rem; margin: 0 0 .25rem; font-weight: 650; letter-spacing: .01em; }
h2 { font-size: 1.1rem; margin: 0; font-weight: 600; }
code { background: var(--card2); padding: .1em .35em; border-radius: 5px; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
[hidden] { display: none !important; }

/* ---------- Karten ---------- */
.card {
  background: linear-gradient(180deg, var(--card), var(--bg2));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, .35);
}
.card + .card, .card + .section-title, .section-title + .card { margin-top: 1rem; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; }

/* ---------- Öffentliche Seiten ---------- */
.center-wrap { flex: 1; display: flex; align-items: center; justify-content: center; padding: 2rem 1rem; }
.upload-card { width: 100%; max-width: 620px; }
.login-card { width: 100%; max-width: 400px; }
.logo { display: block; width: 100%; max-width: 360px; height: auto; margin: 0 auto 1.5rem; }
.login-card .logo { max-width: 300px; }
.infobox {
  background: var(--blue-soft);
  border-left: 3px solid var(--blue);
  padding: .75rem 1rem;
  border-radius: 8px;
  margin: 1rem 0;
}

.drop {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: .25rem;
  margin: 1.25rem 0 .75rem;
  padding: 2.2rem 1rem;
  border: 2px dashed #2c3a4e;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .015);
  cursor: pointer;
  text-align: center;
  transition: border-color .15s, background .15s;
}
.drop:hover, .drop.over { border-color: var(--blue); background: var(--blue-soft); }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop-icon {
  width: 54px; height: 54px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 1.6rem; color: #fff;
  background: var(--blue);
  box-shadow: 0 0 0 6px var(--blue-soft);
  margin-bottom: .5rem;
}
.drop-title { font-weight: 600; }
.drop-sub { color: var(--muted); font-size: .85rem; }

.filelist { list-style: none; margin: 0 0 1rem; padding: 0; }
.filelist li {
  display: flex; align-items: center; gap: .75rem;
  padding: .5rem .75rem;
  background: var(--card2);
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: .4rem;
  font-size: .9rem;
}
.filelist li.bad { border-color: var(--red); }
.filelist .fn { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filelist .fs { color: var(--muted); font-size: .8rem; white-space: nowrap; }
.filelist li.bad .fs { color: var(--red); }
.filelist button {
  background: none; border: 0; color: var(--muted); font-size: 1.2rem; cursor: pointer; line-height: 1; padding: 0 .2rem;
}
.filelist button:hover { color: var(--red); }

.progress { margin: 1rem 0; }
.bar { height: 10px; background: var(--card2); border-radius: 99px; overflow: hidden; border: 1px solid var(--line); }
.bar > div { height: 100%; width: 0; background: linear-gradient(90deg, var(--blue), var(--blue-h)); transition: width .2s; }
.progress-text { font-size: .82rem; color: var(--muted); margin-top: .35rem; text-align: right; }

.state { text-align: center; padding: .5rem 0 1rem; }
.state p { margin: .5rem 0 1.25rem; }
.state-icon {
  width: 64px; height: 64px; border-radius: 50%;
  display: grid; place-items: center; margin: 0 auto 1rem;
  font-size: 1.8rem; color: #fff;
}
.state-icon.ok { background: var(--green); box-shadow: 0 0 0 8px rgba(47, 191, 113, .15); }
.state-icon.off { background: #3a4656; box-shadow: 0 0 0 8px rgba(255, 255, 255, .04); }

/* ---------- Formulare ---------- */
.field { display: block; margin-bottom: 1rem; }
.field > span { display: block; font-size: .85rem; color: var(--muted); margin-bottom: .35rem; }
.field em { font-style: normal; opacity: .7; }
input[type=text], input[type=password], textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 9px;
  padding: .65rem .8rem;
  font: inherit;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
textarea { resize: vertical; }
.grid-form { margin-top: 1rem; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  background: var(--blue);
  color: #fff;
  border: 1px solid var(--blue);
  border-radius: 9px;
  padding: .65rem 1.2rem;
  font: inherit; font-weight: 600;
  cursor: pointer;
  text-decoration: none !important;
  transition: background .15s, border-color .15s, opacity .15s;
  white-space: nowrap;
}
.btn:hover { background: var(--blue-h); border-color: var(--blue-h); }
.btn:disabled { opacity: .6; cursor: progress; }
.btn-wide { width: 100%; padding: .8rem; font-size: 1rem; }
.btn-sm { padding: .38rem .75rem; font-size: .85rem; font-weight: 500; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn-ghost:hover { background: var(--card2); border-color: #34445a; }
.btn-danger { background: transparent; color: var(--red); border-color: rgba(229, 72, 77, .45); }
.btn-danger:hover { background: rgba(229, 72, 77, .12); border-color: var(--red); }
form.inline { display: inline; margin: 0; }

.alert { padding: .75rem 1rem; border-radius: 9px; margin: 0 0 1rem; font-size: .92rem; }
.alert.err { background: rgba(229, 72, 77, .12); border: 1px solid rgba(229, 72, 77, .4); color: #ffb4b6; }
.alert.ok { background: rgba(47, 191, 113, .10); border: 1px solid rgba(47, 191, 113, .35); color: #a8f0c8; }
.alert.warn { background: rgba(240, 160, 32, .10); border: 1px solid rgba(240, 160, 32, .4); color: #ffd590; }

/* ---------- Admin ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: .7rem 1.5rem;
  background: rgba(11, 15, 20, .85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: .9rem; color: var(--text); text-decoration: none !important; }
.brand img { height: 38px; width: auto; }
.brand span { font-weight: 600; color: var(--muted); border-left: 1px solid var(--line); padding-left: .9rem; }
.admin-wrap { width: 100%; max-width: 1100px; margin: 0 auto; padding: 1.5rem 1rem 3rem; flex: 1; }
.section-title { margin: 2rem 0 .75rem; font-size: 1.1rem; font-weight: 600; }
.section-title.row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.back { display: inline-block; margin-bottom: 1rem; color: var(--muted); }
.actions { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; }
.empty { text-align: center; color: var(--muted); }

.badge {
  display: inline-block;
  font-size: .72rem; font-weight: 600; letter-spacing: .03em;
  padding: .15rem .55rem; border-radius: 99px;
  vertical-align: middle; margin-left: .35rem;
  text-transform: uppercase;
}
.badge.on { background: rgba(47, 191, 113, .15); color: var(--green); }
.badge.off { background: rgba(139, 150, 165, .15); color: var(--muted); }
.badge.new { background: var(--blue); color: #fff; }
.card-head .badge:first-of-type { margin-left: 0; margin-right: .4rem; }

.copyrow { display: flex; gap: .5rem; margin-top: 1rem; }
.copyrow input { flex: 1; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .85rem; }

.edit { margin-top: 1rem; }
.edit summary { cursor: pointer; color: var(--muted); font-size: .9rem; }
.edit summary:hover { color: var(--text); }
.internal { margin: 1rem 0 0; font-size: .9rem; color: var(--muted); }

.table-wrap { padding: 0; overflow-x: auto; }
table.links { width: 100%; border-collapse: collapse; }
table.links th, table.links td { padding: .85rem 1rem; text-align: left; vertical-align: middle; }
table.links th { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; border-bottom: 1px solid var(--line); }
table.links tr + tr td { border-top: 1px solid var(--line); }
table.links tbody tr:hover { background: rgba(255, 255, 255, .02); }
table.links tr.inactive .lbl { color: var(--muted); }
table.links td.actions { justify-content: flex-end; flex-wrap: nowrap; }
.lbl { font-weight: 600; color: var(--text); }

.sub.is-new { border-color: rgba(13, 132, 220, .55); box-shadow: 0 0 0 1px rgba(13, 132, 220, .25), 0 10px 40px rgba(0, 0, 0, .35); }
.note {
  margin-top: 1rem;
  padding: .8rem 1rem;
  background: var(--bg);
  border: 1px solid var(--line);
  border-left: 3px solid var(--blue);
  border-radius: 8px;
  white-space: normal;
  word-wrap: break-word;
}
.files { list-style: none; padding: 0; margin: 1rem 0 0; }
.files li {
  display: flex; justify-content: space-between; gap: 1rem;
  padding: .5rem 0;
  border-top: 1px dashed var(--line);
  font-size: .92rem;
}
.files li a { overflow-wrap: anywhere; }
.files li a::before { content: "↓ "; color: var(--muted); }

.recent { list-style: none; padding: 0; margin: 0; }
.recent li { display: flex; justify-content: space-between; gap: 1rem; padding: .55rem 0; }
.recent li + li { border-top: 1px solid var(--line); }
.recent li.is-new strong::after { content: ""; display: inline-block; width: 8px; height: 8px; background: var(--blue); border-radius: 50%; margin-left: .45rem; vertical-align: middle; }
.recent a { color: var(--text); }

.foot { text-align: center; color: var(--muted); font-size: .8rem; padding: 1.5rem 1rem; opacity: .7; }

/* ---------- QR-Code ---------- */
.link-qr { display: flex; gap: 1.25rem; align-items: flex-start; }
.link-qr .copyrow { flex: 1; }
.qr-box { margin-top: 1rem; display: flex; flex-direction: column; align-items: center; gap: .5rem; }
.qr-box img, .qr-dialog img {
  display: block; background: #fff; border-radius: 10px;
  box-shadow: 0 0 0 1px var(--line), 0 6px 24px rgba(0, 0, 0, .4);
  image-rendering: pixelated;
}
.qr-actions { display: flex; gap: .4rem; justify-content: center; }
.qr-dialog {
  background: var(--card); color: var(--text);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.5rem; text-align: center; max-width: 92vw;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .6);
}
.qr-dialog::backdrop { background: rgba(5, 8, 12, .75); backdrop-filter: blur(3px); }
.qr-dialog h2 { margin-bottom: 1rem; }
.qr-dialog img { margin: 0 auto; width: 260px; height: 260px; max-width: 100%; height: auto; }
.qr-url { margin: .8rem 0 1rem; word-break: break-all; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

@media (max-width: 700px) {
  .link-qr { flex-direction: column; align-items: stretch; }
  .card { padding: 1.1rem; }
  .brand span { display: none; }
  table.links thead { display: none; }
  table.links tr { display: block; padding: .75rem 1rem; }
  table.links tr + tr { border-top: 1px solid var(--line); }
  table.links td { display: block; padding: .2rem 0; border: 0 !important; }
  table.links td.actions { justify-content: flex-start; flex-wrap: wrap; margin-top: .4rem; }
  .copyrow { flex-wrap: wrap; }
}
