:root { color-scheme: light dark; font-family: system-ui, -apple-system, Segoe UI, sans-serif; }
body { margin: 0; background: #f4f6f8; color: #18212b; }
.wrap { max-width: 760px; margin: 8vh auto; padding: 20px; }
.card { background: #fff; border-radius: 18px; padding: 32px; box-shadow: 0 20px 55px rgba(0,0,0,.08); }
h1 { margin-top: 0; }
.brand-header { margin: 0 0 18px; }
.brand-header h1 { margin: 0; }
.brand-header-center { text-align: center; }
.brand-header-center .brand-logo { display:block; margin: 0 auto 18px; }
.brand-header-left { display:flex; align-items:center; gap: 20px; }
.brand-header-left .brand-logo { flex: 0 0 auto; margin: 0; }
.brand-logo { display:block; max-width: 220px; max-height: 88px; width: auto; height: auto; object-fit: contain; }
.muted { color: #667085; }
.form { display: grid; gap: 16px; margin-top: 24px; }
input { width: 100%; box-sizing: border-box; padding: 12px 14px; border: 1px solid #cfd6df; border-radius: 10px; font-size: 16px; }
button { cursor: pointer; border: 0; border-radius: 10px; padding: 12px 18px; font-weight: 700; background: #162033; color: #fff; }
a { color: #162033; }
.alert { background: #fff1f0; border: 1px solid #ffccc7; padding: 12px; border-radius: 10px; }
.topline { display:flex; align-items:center; justify-content:space-between; gap: 16px; }
.topline-right { margin-left: auto; }
.drop { margin-top: 24px; border: 2px dashed #aab4c0; border-radius: 18px; padding: 42px 24px; text-align: center; background: #fafbfc; }
.drop.over { background: #eef4ff; border-color: #4778ff; }
.progressbox { margin-top: 24px; }
.hidden { display: none; }
.progress { height: 18px; background: #e8edf3; border-radius: 999px; overflow: hidden; }
.progress > div { height: 100%; width: 0%; background: #162033; transition: width .2s ease; }
.status { margin-top: 10px; color: #344054; }
@media (prefers-color-scheme: dark) {
  body { background:#111827; color:#f9fafb; }
  .card { background:#1f2937; }
  .muted,.status { color:#cbd5e1; }
  .drop { background:#111827; }
  input { background:#111827; color:#fff; border-color:#4b5563; }
  a { color:#93c5fd; }
}

.mt { margin-top: 22px; }
.small { font-size: 14px; }
.ok { background: #ecfdf3; border: 1px solid #abefc6; padding: 12px; border-radius: 10px; color: #067647; }
select { width: 100%; box-sizing: border-box; padding: 12px 14px; border: 1px solid #cfd6df; border-radius: 10px; font-size: 16px; background: #fff; color: #18212b; }
.tablewrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid #e5e7eb; }
@media (prefers-color-scheme: dark) {
  .ok { background:#052e1b; border-color:#047857; color:#bbf7d0; }
  select { background:#111827; color:#fff; border-color:#4b5563; }
  th, td { border-bottom-color:#374151; }
}
.wrap.wide { width: 100%; max-width: 100%; box-sizing: border-box; }
.wrap.admin-constrained { max-width: 1180px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.inlineform { display: inline-flex; gap: 6px; align-items: center; margin: 0; }
button.secondary, .buttonlink { background: #344054; color: #fff; border-radius: 8px; padding: 8px 10px; font-size: 14px; text-decoration: none; display: inline-block; }
button.danger { background: #b42318; color: #fff; border-radius: 8px; padding: 8px 10px; font-size: 14px; }
.smallinput { width: 180px; padding: 8px 10px; font-size: 14px; }
@media (max-width: 760px) {
  .actions, .inlineform { display: grid; width: 100%; }
  .smallinput { width: 100%; }
  .brand-header-left { display:block; text-align:center; }
  .brand-header-left .brand-logo { margin: 0 auto 18px; }
}

.logbox{max-height:360px;overflow:auto;background:#101826;border:1px solid #26344d;border-radius:10px;padding:12px;font-size:12px;line-height:1.4;white-space:pre-wrap}

.filters { display: grid; grid-template-columns: repeat(6, minmax(140px, 1fr)); gap: 12px; align-items: end; margin: 16px 0; }
.badge { display: inline-block; border-radius: 999px; padding: 4px 9px; background: #eef2f7; color: #344054; font-size: 13px; font-weight: 700; }
.detailscell { max-width: 360px; word-break: break-word; font-size: 13px; color: #475467; }
@media (max-width: 1000px) { .filters { grid-template-columns: repeat(2, minmax(140px, 1fr)); } }
@media (max-width: 560px) { .filters { grid-template-columns: 1fr; } }
@media (prefers-color-scheme: dark) {
  .badge { background:#334155; color:#e5e7eb; }
  .detailscell { color:#cbd5e1; }
}
.settingsform{grid-template-columns:repeat(auto-fit,minmax(220px,1fr));align-items:end}
.checkline{display:flex;gap:8px;align-items:center;margin-top:22px}
.checkline input{width:auto}
.mt-small{margin-top:10px}
code{background:#101826;border:1px solid #26344d;border-radius:5px;padding:1px 5px;color:#d9e7ff}

/* v14: Aktivitätslog besser bedienbar */
#activityLogTable th[draggable="true"] { cursor: move; user-select: none; white-space: nowrap; }
#activityLogTable th.dragging { opacity: .55; }
#activityLogTable th.dragover { outline: 2px dashed #667085; outline-offset: -4px; }
#activityLogTable td, #activityLogTable th { vertical-align: top; }
.passwordcell { min-width: 170px; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12px; color: #475467; }
.detailscell { min-width: 280px; }
@media (prefers-color-scheme: dark) { .passwordcell { color:#cbd5e1; } }
.linkcopy-wrap{display:flex;align-items:center;gap:.4rem;min-width:0}
.linkfield{min-width:260px;font-size:.85rem;padding:.35rem .45rem;border:1px solid #334155;border-radius:8px;background:#0f172a;color:#e2e8f0}
.copylink-btn{display:inline-flex;align-items:center;justify-content:center;width:38px;height:38px;border:1px solid #334155;border-radius:8px;background:#0f172a;color:#e2e8f0;padding:0;flex:0 0 auto}
.copylink-btn svg{width:18px;height:18px;fill:currentColor}
.copylink-btn:hover{background:#162033}
.copylink-btn.copied{background:#067647;border-color:#067647;color:#ecfdf3}
.ok-linkcopy{margin-top:.55rem}
.tinyinput{width:70px;max-width:70px;padding:.35rem .45rem;border:1px solid #334155;border-radius:8px;background:#0f172a;color:#e2e8f0}
.shareform{gap:.35rem;align-items:center;flex-wrap:wrap;margin-bottom:.35rem}
.infogrid{display:grid;grid-template-columns:160px 1fr;gap:.4rem .9rem;margin:1rem 0}.infogrid dt{font-weight:700;color:#94a3b8}.infogrid dd{margin:0}
.share-qr-block{display:grid;gap:.55rem;justify-items:start;margin-top:.85rem}
.share-qr-image{display:inline-flex;align-items:center;justify-content:center;width:156px;height:156px;padding:10px;border:1px solid #d0d5dd;border-radius:14px;background:#fff}
.share-qr-image svg{display:block;width:100%;height:100%}
.share-qr-toggle{margin-top:.35rem}
.share-qr-toggle summary{cursor:pointer;color:#162033;font-weight:700;list-style:none}
.share-qr-toggle summary::-webkit-details-marker{display:none}
.share-qr-panel{margin-top:.55rem}

/* v17: Freigabelinks direkt unter Dateien */
.sharelinks-under-file{width:100%;margin:.45rem 0;padding:.55rem;border:1px solid #e5e7eb;border-radius:10px;background:#f8fafc}
.sharelink-row{display:flex;gap:.55rem;justify-content:space-between;align-items:flex-start;padding:.45rem 0;border-top:1px solid #e5e7eb}
.sharelink-row:first-of-type{border-top:0}
.sharelink-row.inactive{opacity:.72}
.sharelink-main{display:grid;gap:.25rem;min-width:280px;flex:1}
.sharelink-actions{display:flex;gap:.35rem;flex-wrap:wrap;justify-content:flex-end}
@media (max-width:900px){.sharelink-row{display:grid}.sharelink-actions{justify-content:flex-start}.linkfield{width:100%;min-width:0}.linkcopy-wrap{width:100%}}
@media (prefers-color-scheme: dark){.sharelinks-under-file{background:#111827;border-color:#374151}.sharelink-row{border-top-color:#374151}.share-qr-image{background:#fff;border-color:#475467}.share-qr-toggle summary{color:#93c5fd}}
