/* =========================================================================
   FileShare – Neon Dark Theme
   ========================================================================= */

:root,
:root[data-theme="dark"] {
  --bg: #06070c;
  --bg-2: #0a0b12;
  --surface: rgba(255, 255, 255, 0.028);
  --surface-hover: rgba(255, 255, 255, 0.055);
  --surface-active: rgba(139, 92, 246, 0.12);
  --panel: rgba(15, 17, 27, 0.72);
  --panel-solid: #10121c;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #e9ecf6;
  --text-dim: #8a92ac;
  --text-faint: #5a6178;
  --accent: #8b5cf6;
  --accent-2: #22d3ee;
  --accent-soft: rgba(139, 92, 246, 0.16);
  --accent-grad: linear-gradient(135deg, #8b5cf6 0%, #22d3ee 100%);
  --glow: 0 0 22px rgba(139, 92, 246, 0.35);
  --glow-cyan: 0 0 22px rgba(34, 211, 238, 0.28);
  --danger: #fb5a76;
  --danger-soft: rgba(251, 90, 118, 0.14);
  --success: #34d399;
  --warning: #fbbf24;
  --radius: 12px;
  --radius-sm: 9px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
  --shadow-sm: 0 6px 20px rgba(0, 0, 0, 0.4);
  --header-h: 62px;
  --toolbar-h: 52px;
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #eef1f8;
  --bg-2: #ffffff;
  --surface: rgba(15, 18, 30, 0.03);
  --surface-hover: rgba(139, 92, 246, 0.08);
  --surface-active: rgba(139, 92, 246, 0.14);
  --panel: rgba(255, 255, 255, 0.82);
  --panel-solid: #ffffff;
  --border: rgba(20, 24, 40, 0.1);
  --border-strong: rgba(20, 24, 40, 0.18);
  --text: #141827;
  --text-dim: #5b6376;
  --text-faint: #8a91a3;
  --accent: #7c3aed;
  --accent-2: #0891b2;
  --accent-soft: rgba(124, 58, 237, 0.12);
  --accent-grad: linear-gradient(135deg, #7c3aed 0%, #0891b2 100%);
  --glow: 0 8px 26px rgba(124, 58, 237, 0.28);
  --glow-cyan: 0 8px 26px rgba(8, 145, 178, 0.22);
  --danger: #e11d48;
  --danger-soft: rgba(225, 29, 72, 0.1);
  --success: #059669;
  --warning: #d97706;
  --shadow: 0 18px 50px rgba(30, 40, 80, 0.16);
  --shadow-sm: 0 6px 20px rgba(30, 40, 80, 0.1);
  color-scheme: light;
}

* { box-sizing: border-box; }

/* Das hidden-Attribut muss jede display-Regel überschreiben */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  height: 100%;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.45;
  color: var(--text);
  background: var(--bg);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Hintergrund-Glows + Raster */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(620px 420px at 12% -8%, rgba(139, 92, 246, 0.20), transparent 62%),
    radial-gradient(720px 520px at 104% -4%, rgba(34, 211, 238, 0.13), transparent 58%),
    radial-gradient(600px 600px at 50% 120%, rgba(139, 92, 246, 0.08), transparent 60%);
  pointer-events: none;
  z-index: 0;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.028) 1px, transparent 1px);
  background-size: 46px 46px;
  -webkit-mask-image: radial-gradient(circle at 50% 0%, #000 0%, transparent 72%);
  mask-image: radial-gradient(circle at 50% 0%, #000 0%, transparent 72%);
  pointer-events: none;
  z-index: 0;
}

:root[data-theme="light"] body::after { opacity: 0.5; }

svg { display: block; }
button { font-family: inherit; }

/* =========================================================================
   Brand / Logo
   ========================================================================= */

.brand { display: flex; align-items: center; gap: 10px; user-select: none; }
.brand--center { justify-content: center; margin-bottom: 8px; }

.brand__mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--accent-grad);
  box-shadow: var(--glow);
  color: #fff;
}
.brand__mark svg { width: 19px; height: 19px; }

.brand__name {
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.4px;
  background: var(--accent-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* =========================================================================
   Buttons / Inputs
   ========================================================================= */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 36px;
  padding: 0 13px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 13.5px;
  font-weight: 550;
  cursor: pointer;
  transition: background .16s ease, border-color .16s ease, box-shadow .16s ease, transform .1s ease;
  white-space: nowrap;
}
.btn:hover { background: var(--surface-hover); border-color: var(--border-strong); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn svg { width: 17px; height: 17px; }

.btn__icon { display: inline-flex; }

.btn--primary {
  background: var(--accent-grad);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 16px rgba(139, 92, 246, 0.32);
}
.btn--primary:hover {
  background: var(--accent-grad);
  box-shadow: var(--glow);
  filter: brightness(1.06);
}

.btn--ghost { background: transparent; border-color: transparent; }
.btn--ghost:hover { background: var(--surface-hover); border-color: var(--border); }

.btn--danger {
  background: var(--danger-soft);
  border-color: rgba(251, 90, 118, 0.35);
  color: var(--danger);
}
.btn--danger:hover { background: rgba(251, 90, 118, 0.22); border-color: var(--danger); }

.btn--icon { width: 36px; padding: 0; }
.btn--sm { height: 30px; padding: 0 10px; font-size: 12.5px; }
.btn--icon.btn--sm { width: 30px; }
.btn--sm svg { width: 15px; height: 15px; }
.btn--block { width: 100%; height: 42px; }

.select {
  height: 36px;
  padding: 0 30px 0 11px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 13.5px;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238a92ac' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
}
.select:focus { outline: none; border-color: var(--accent); }

input[type="text"], input[type="password"], input[type="search"] {
  width: 100%;
  height: 36px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  transition: border-color .16s ease, box-shadow .16s ease;
}
input::placeholder { color: var(--text-faint); }
input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* =========================================================================
   Login
   ========================================================================= */

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  position: relative;
  width: 100%;
  max-width: 380px;
  padding: 34px 30px 30px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--panel);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.login-glow {
  position: absolute;
  top: -60%;
  left: 50%;
  width: 300px;
  height: 300px;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(139, 92, 246, 0.35), transparent 70%);
  pointer-events: none;
}

.login-sub {
  text-align: center;
  color: var(--text-dim);
  margin: 14px 0 22px;
  font-size: 13.5px;
}

.login-form { display: flex; flex-direction: column; gap: 16px; position: relative; }

.field { display: flex; flex-direction: column; gap: 7px; }
.field__label { font-size: 12.5px; color: var(--text-dim); font-weight: 550; }

.login-error {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--danger-soft);
  border: 1px solid rgba(251, 90, 118, 0.35);
  color: var(--danger);
  font-size: 13px;
  text-align: center;
}

/* =========================================================================
   App-Layout
   ========================================================================= */

.app {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  height: var(--header-h);
  padding: 0 18px;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  flex-shrink: 0;
  position: relative;
  z-index: 30;
}

.breadcrumbs {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 2px;
  min-width: 0;
  overflow: hidden;
  font-size: 13.5px;
}

.crumb {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border-radius: 7px;
  color: var(--text-dim);
  cursor: pointer;
  white-space: nowrap;
  transition: background .14s ease, color .14s ease;
}
.crumb:hover { background: var(--surface-hover); color: var(--text); }
.crumb.is-current { color: var(--text); font-weight: 600; }
.crumb svg { width: 14px; height: 14px; }
.crumb-sep { color: var(--text-faint); display: inline-flex; }
.crumb-sep svg { width: 14px; height: 14px; }

.topbar__actions { display: flex; align-items: center; gap: 8px; }

.search { position: relative; width: 210px; }
.search__icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-faint);
  pointer-events: none;
}
.search__icon svg { width: 16px; height: 16px; }
.search input { padding-left: 32px; }

/* Toolbar */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: var(--toolbar-h);
  padding: 0 18px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.toolbar__left, .toolbar__right { display: flex; align-items: center; gap: 8px; }

.current-folder {
  color: var(--text-dim);
  font-size: 13px;
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.selection-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-right: 8px;
  margin-right: 4px;
  border-right: 1px solid var(--border);
}
.selection-count { color: var(--accent-2); font-size: 12.5px; font-weight: 600; }

.segmented {
  display: inline-flex;
  padding: 3px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
}
.segmented__btn {
  display: grid;
  place-items: center;
  width: 30px;
  height: 28px;
  border: none;
  background: transparent;
  color: var(--text-dim);
  border-radius: 7px;
  cursor: pointer;
  transition: background .14s ease, color .14s ease;
}
.segmented__btn svg { width: 16px; height: 16px; }
.segmented__btn:hover { color: var(--text); }
.segmented__btn.is-active { background: var(--accent-soft); color: var(--accent-2); }

.sort { display: flex; align-items: center; gap: 6px; }

/* Content */
.content {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  position: relative;
}

/* Scrollbar */
.content::-webkit-scrollbar { width: 10px; height: 10px; }
.content::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 8px;
  border: 2px solid transparent;
  background-clip: content-box;
}
.content::-webkit-scrollbar-thumb:hover { background: var(--accent-soft); background-clip: content-box; }

/* =========================================================================
   Items – Grid
   ========================================================================= */

.items--grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(152px, 1fr));
  gap: 12px;
}

.item {
  position: relative;
  display: flex;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  user-select: none;
  transition: background .15s ease, border-color .15s ease, box-shadow .15s ease, transform .1s ease;
}
.item:hover {
  background: var(--surface-hover);
  border-color: var(--border-strong);
  box-shadow: 0 0 0 1px rgba(139, 92, 246, 0.25), 0 8px 24px rgba(0, 0, 0, 0.28);
}
.item.is-selected {
  background: var(--surface-active);
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), var(--glow);
}
.item.is-drop-target {
  border-color: var(--accent-2);
  background: rgba(34, 211, 238, 0.1);
  box-shadow: 0 0 0 2px var(--accent-2), var(--glow-cyan);
}

.items--grid .item {
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 16px 12px 13px;
  text-align: center;
}
.items--grid .item__icon-wrap {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: var(--surface-hover);
}
.items--grid .item__icon-wrap svg { width: 27px; height: 27px; }
.items--grid .item__icon-wrap.has-thumb {
  width: 100%;
  height: 96px;
  background: transparent;
  border-radius: 9px;
  overflow: hidden;
}
.items--grid .item__icon-wrap.has-thumb svg { display: none; }
.items--grid .item__icon-wrap.has-thumb .item__thumb { width: 100%; height: 100%; }
.items--grid .item__thumb {
  width: 100%;
  height: 96px;
  object-fit: cover;
  border-radius: 9px;
  background: var(--surface-hover);
}
.items--grid .item__name {
  font-size: 13px;
  font-weight: 550;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.items--grid .item__meta { font-size: 11.5px; color: var(--text-faint); }

/* =========================================================================
   Items – Liste
   ========================================================================= */

.items--list {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}

.items--list .item {
  border: none;
  border-radius: 0;
  border-bottom: 1px solid var(--border);
  padding: 0 14px;
  height: 46px;
  align-items: center;
  gap: 12px;
}
.items--list .item:last-child { border-bottom: none; }
.items--list .item:hover { background: var(--surface-hover); box-shadow: none; }
.items--list .item.is-selected { box-shadow: inset 3px 0 0 var(--accent); }
.items--list .item__icon-wrap { width: 26px; display: grid; place-items: center; flex-shrink: 0; }
.items--list .item__icon-wrap svg { width: 19px; height: 19px; }
.items--list .item__thumb { display: none; }
.items--list .item__name { flex: 1; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.items--list .item__meta { font-size: 12.5px; color: var(--text-dim); width: 120px; text-align: right; flex-shrink: 0; }
.items--list .item__meta--date { width: 160px; }

.item__name { display: block; }
.item__meta { font-variant-numeric: tabular-nums; }

/* Icon-Farben nach Typ */
.icon--dir { color: var(--accent); }
.icon--image { color: var(--accent-2); }
.icon--archive { color: var(--warning); }
.icon--video { color: #f472b6; }
.icon--audio { color: #a78bfa; }
.icon--file { color: var(--text-dim); }

/* =========================================================================
   Empty State
   ========================================================================= */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 60vh;
  text-align: center;
  padding: 40px;
}
.empty-state__icon {
  display: grid;
  place-items: center;
  width: 84px;
  height: 84px;
  border-radius: 22px;
  margin-bottom: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--glow);
}
.empty-state__icon svg { width: 40px; height: 40px; color: var(--accent); }
.empty-state__title { margin: 0; font-size: 18px; }
.empty-state__text { margin: 0 0 14px; color: var(--text-dim); font-size: 13.5px; }

/* =========================================================================
   Statusbar
   ========================================================================= */

.statusbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 30px;
  padding: 0 18px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-faint);
  flex-shrink: 0;
}

.live { display: inline-flex; align-items: center; gap: 6px; }
.live__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-faint);
  transition: background .2s ease, box-shadow .2s ease;
}
.live.is-on { color: var(--success); }
.live.is-on .live__dot {
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
  animation: live-pulse 2.2s ease-in-out infinite;
}
.live.is-off { color: var(--danger); }
.live.is-off .live__dot { background: var(--danger); }

@keyframes live-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .35; }
}

/* =========================================================================
   Drop Overlay
   ========================================================================= */

.drop-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  background: rgba(6, 7, 12, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.drop-overlay__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 48px 60px;
  border-radius: 20px;
  border: 2px dashed var(--accent);
  background: var(--accent-soft);
  box-shadow: var(--glow);
  animation: pop .18s ease;
}
.drop-overlay__icon { color: var(--accent-2); }
.drop-overlay__icon svg { width: 46px; height: 46px; }
.drop-overlay__title { font-size: 19px; font-weight: 700; }
.drop-overlay__sub { font-size: 13px; color: var(--text-dim); }

@keyframes pop {
  from { transform: scale(.96); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* =========================================================================
   Kontextmenü
   ========================================================================= */

.context-menu {
  position: fixed;
  z-index: 90;
  min-width: 208px;
  padding: 6px;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  background: var(--panel-solid);
  box-shadow: var(--shadow);
  animation: pop .12s ease;
}
.ctx-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 13.5px;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
}
.ctx-item:hover { background: var(--surface-hover); }
.ctx-item svg { width: 16px; height: 16px; color: var(--text-dim); }
.ctx-item--danger { color: var(--danger); }
.ctx-item--danger svg { color: var(--danger); }
.ctx-item__hint { margin-left: auto; font-size: 11px; color: var(--text-faint); }
.ctx-sep { height: 1px; margin: 5px 8px; background: var(--border); }

/* =========================================================================
   Upload-Panel
   ========================================================================= */

.upload-panel {
  position: fixed;
  right: 84px;
  bottom: 44px;
  width: 320px;
  max-height: 300px;
  display: flex;
  flex-direction: column;
  border-radius: 14px;
  border: 1px solid var(--border-strong);
  background: var(--panel-solid);
  box-shadow: var(--shadow);
  z-index: 70;
  overflow: hidden;
}
.upload-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}
.upload-panel__title { font-size: 13px; font-weight: 650; }
.upload-panel__list { overflow-y: auto; padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.upload-panel.is-collapsed .upload-panel__list { display: none; }
.upload-panel.is-collapsed { max-height: none; }

.upload-item {
  padding: 8px 10px;
  border-radius: 9px;
  background: var(--surface);
}
.upload-item__top { display: flex; align-items: center; gap: 8px; }
.upload-item__name { flex: 1; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-item__pct { font-size: 11.5px; color: var(--text-dim); font-variant-numeric: tabular-nums; }
.upload-item__cancel {
  border: none; background: transparent; color: var(--text-faint); cursor: pointer; padding: 2px;
  display: inline-flex;
}
.upload-item__cancel:hover { color: var(--danger); }
.upload-item__cancel svg { width: 14px; height: 14px; }
.upload-item__bar {
  margin-top: 7px;
  height: 4px;
  border-radius: 4px;
  background: var(--surface-hover);
  overflow: hidden;
}
.upload-item__fill {
  height: 100%;
  width: 0%;
  border-radius: 4px;
  background: var(--accent-grad);
  transition: width .18s ease;
}
.upload-item.is-done .upload-item__fill { background: var(--success); }
.upload-item.is-error .upload-item__fill { background: var(--danger); }
.upload-item.is-error .upload-item__pct { color: var(--danger); }

/* =========================================================================
   Toasts
   ========================================================================= */

.toasts {
  position: fixed;
  top: 74px;
  right: 18px;
  z-index: 95;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 240px;
  max-width: 380px;
  padding: 11px 14px;
  border-radius: 11px;
  border: 1px solid var(--border-strong);
  background: var(--panel-solid);
  box-shadow: var(--shadow-sm);
  font-size: 13px;
  animation: slide-in .2s ease;
}
.toast svg { width: 17px; height: 17px; flex-shrink: 0; }
.toast--success { border-left: 3px solid var(--success); }
.toast--success svg { color: var(--success); }
.toast--error { border-left: 3px solid var(--danger); }
.toast--error svg { color: var(--danger); }
.toast--info { border-left: 3px solid var(--accent-2); }
.toast--info svg { color: var(--accent-2); }
.toast.is-leaving { animation: slide-out .18s ease forwards; }

@keyframes slide-in {
  from { transform: translateX(24px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
@keyframes slide-out {
  to { transform: translateX(24px); opacity: 0; }
}

/* =========================================================================
   Modals
   ========================================================================= */

.modal-root { position: fixed; inset: 0; z-index: 92; display: grid; place-items: center; padding: 24px; }
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 5, 9, 0.66);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.modal {
  position: relative;
  width: 100%;
  max-width: 440px;
  padding: 24px;
  border-radius: 16px;
  border: 1px solid var(--border-strong);
  background: var(--panel-solid);
  box-shadow: var(--shadow);
  animation: pop .16s ease;
}
.modal--wide { max-width: 560px; }
.modal__title { margin: 0 0 6px; font-size: 17px; font-weight: 680; }
.modal__text { margin: 0 0 18px; color: var(--text-dim); font-size: 13.5px; }
.modal__text strong { color: var(--text); }
.modal__field { margin-bottom: 18px; }
.modal__actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

/* Verschieben-Wähler */
.mover-list {
  max-height: 300px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
}
.mover-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 12px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
}
.mover-row:last-child { border-bottom: none; }
.mover-row:hover { background: var(--surface-hover); }
.mover-row svg { width: 17px; height: 17px; color: var(--accent); }
.mover-path { color: var(--text-dim); font-size: 12.5px; padding: 6px 12px; }

/* Vorschau */
.preview-body { display: grid; place-items: center; min-height: 120px; margin-bottom: 4px; }
.preview-body img { max-width: 100%; max-height: 62vh; border-radius: 10px; }
.preview-body pre {
  width: 100%;
  max-height: 62vh;
  overflow: auto;
  margin: 0;
  padding: 14px;
  border-radius: 10px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  font-family: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 12.5px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

/* =========================================================================
   Responsive
   ========================================================================= */

@media (max-width: 900px) {
  .search { width: 150px; }
  .btn--label, .btn__label { display: none; }
  .current-folder { display: none; }
}

@media (max-width: 640px) {
  .topbar { gap: 8px; padding: 0 12px; }
  .brand__name { display: none; }
  .search { width: 120px; }
  .toolbar { padding: 0 12px; }
  .content { padding: 14px; }
  .items--grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
  .items--list .item__meta--date { display: none; }
  .upload-panel { right: 10px; left: 10px; width: auto; }
  .selection-count { display: none; }
}

/* =========================================================================
   Nutzer-Menü / Dropdown
   ========================================================================= */

.usermenu { position: relative; }

.userchip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 13px;
}
.userchip::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-grad);
  box-shadow: var(--glow);
}

.dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 60;
  min-width: 220px;
  padding: 6px;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  background: var(--panel-solid);
  box-shadow: var(--shadow);
  animation: pop .12s ease;
}
.dropdown__head {
  padding: 8px 10px 10px;
  font-size: 12.5px;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border);
  margin-bottom: 6px;
}
.dropdown__head b { color: var(--text); }
.dropdown__item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 13.5px;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
}
.dropdown__item:hover { background: var(--surface-hover); }
.dropdown__item svg { width: 16px; height: 16px; color: var(--text-dim); }
.dropdown__sep { height: 1px; margin: 5px 8px; background: var(--border); }

/* =========================================================================
   Statusleiste: Online + Speicher
   ========================================================================= */

.online,
.storage {
  margin-right: 14px;
  color: var(--text-dim);
}
.online { display: inline-flex; align-items: center; gap: 10px; }
.online__user { display: inline-flex; align-items: center; gap: 5px; }
.online__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-faint);
}
.online__user.is-on .online__dot {
  background: var(--success);
  box-shadow: 0 0 7px var(--success);
  animation: live-pulse 2.2s ease-in-out infinite;
}
.online__user.is-on { color: var(--text); }
.online__user.is-me::after { content: " (du)"; color: var(--text-faint); }
.storage { font-variant-numeric: tabular-nums; }

/* =========================================================================
   Favoriten-Stern / Badges
   ========================================================================= */

.star {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 2;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text-faint);
  cursor: pointer;
  opacity: 0;
  transition: opacity .15s ease, color .15s ease, background .15s ease;
}
.item:hover .star { opacity: 1; }
.star svg { width: 16px; height: 16px; }
.star.is-on { opacity: 1; color: var(--warning); }
.star.is-on svg { fill: var(--warning); }
.star:hover { background: var(--surface-hover); }

.items--list .star { position: static; opacity: 1; }

/* =========================================================================
   Zusatz-Ansichten (Papierkorb, Freigaben, Aktivitäten, Suche)
   ========================================================================= */

.view-title { margin: 4px 2px 16px; font-size: 18px; font-weight: 700; }
.view-title span { color: var(--text-dim); font-weight: 500; font-size: 13px; margin-left: 8px; }

.list-rows {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}
.row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 14px;
  min-height: 52px;
  border-bottom: 1px solid var(--border);
}
.row:last-child { border-bottom: none; }
.row:hover { background: var(--surface-hover); }
.row__icon { display: grid; place-items: center; width: 26px; flex-shrink: 0; }
.row__icon svg { width: 19px; height: 19px; }
.row__main { flex: 1; min-width: 0; }
.row__title { font-size: 13.5px; font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row__sub { font-size: 12px; color: var(--text-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row__meta { font-size: 12.5px; color: var(--text-dim); font-variant-numeric: tabular-nums; white-space: nowrap; }
.row__actions { display: flex; gap: 6px; }

.search-hit__path { color: var(--accent-2); cursor: pointer; }
.search-hit__path:hover { text-decoration: underline; }

/* =========================================================================
   Vorschau-Medien (Video/Audio/PDF)
   ========================================================================= */

.viewer { width: 100%; display: grid; place-items: center; }
.viewer video { max-width: 100%; max-height: 62vh; border-radius: 10px; background: #000; }
.viewer audio { width: 100%; max-width: 460px; }
.viewer iframe { width: 100%; height: 66vh; border: 1px solid var(--border); border-radius: 10px; background: #fff; }

/* Texteditor */
.editor {
  width: 100%;
  height: 56vh;
  resize: vertical;
  padding: 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-2);
  color: var(--text);
  font-family: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 13px;
  line-height: 1.6;
}
.editor:focus { outline: none; border-color: var(--accent); }

/* =========================================================================
   Teilen-Modal
   ========================================================================= */

.share-grid { display: grid; gap: 16px; }
.share-row { display: flex; gap: 10px; align-items: flex-end; }
.share-link {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 13px;
  word-break: break-all;
}
.share-link code { flex: 1 1 100%; color: var(--accent-2); font-size: 12.5px; user-select: all; cursor: text; }
.share-link .btn { flex: 0 0 auto; }
.share-qr { display: grid; place-items: center; }
.share-qr img { width: 200px; height: 200px; border-radius: 12px; background: #fff; padding: 8px; }

.checkbox { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--text-dim); cursor: pointer; }
.checkbox input { width: 16px; height: 16px; accent-color: var(--accent); }

/* =========================================================================
   Toast mit Aktion
   ========================================================================= */

.toast__action {
  margin-left: auto;
  border: none;
  background: transparent;
  color: var(--accent-2);
  font-weight: 650;
  font-size: 12.5px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
}
.toast__action:hover { background: var(--surface-hover); }

/* Badge für Duplikate etc. */
.badge {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 7px;
  border-radius: 20px;
  font-size: 10.5px;
  font-weight: 650;
  background: var(--accent-soft);
  color: var(--accent-2);
  vertical-align: middle;
}

/* =========================================================================
   Online-Pille (oben)
   ========================================================================= */

.presence {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 12px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 12.5px;
  color: var(--text-dim);
  white-space: nowrap;
  transition: color .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.presence__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-faint);
  transition: background .2s ease, box-shadow .2s ease;
}
.presence.is-on {
  color: var(--text);
  border-color: rgba(52, 211, 153, 0.45);
  box-shadow: 0 0 16px rgba(52, 211, 153, 0.18);
}
.presence.is-on .presence__dot {
  background: var(--success);
  box-shadow: 0 0 9px var(--success);
  animation: live-pulse 2.2s ease-in-out infinite;
}

/* =========================================================================
   Chat
   ========================================================================= */

.chat-fab {
  position: fixed;
  right: 18px;
  bottom: 44px;
  z-index: 75;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: none;
  background: var(--accent-grad);
  color: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: 0 8px 26px rgba(139, 92, 246, 0.45);
  transition: transform .12s ease, box-shadow .16s ease;
}
.chat-fab:hover { transform: translateY(-2px); box-shadow: var(--glow); }
.chat-fab svg { width: 23px; height: 23px; }

.chat-unread {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 10px;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: grid;
  place-items: center;
  box-shadow: 0 0 10px rgba(251, 90, 118, 0.8);
  animation: pop .15s ease;
}

.chat-panel {
  position: fixed;
  right: 18px;
  bottom: 108px;
  z-index: 76;
  width: 360px;
  max-width: calc(100vw - 24px);
  height: 460px;
  max-height: calc(100vh - 140px);
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  border: 1px solid var(--border-strong);
  background: var(--panel-solid);
  box-shadow: var(--shadow);
  overflow: hidden;
  animation: pop .16s ease;
}
.chat-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.chat-panel__title { display: flex; align-items: center; gap: 8px; font-weight: 650; font-size: 14px; }
.chat-status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-faint); }
.chat-status-dot.is-on { background: var(--success); box-shadow: 0 0 8px var(--success); }

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.chat-empty { color: var(--text-faint); font-size: 13px; text-align: center; margin: auto; }

.msg { display: flex; flex-direction: column; align-items: flex-start; max-width: 82%; }
.msg--mine { align-self: flex-end; align-items: flex-end; }
.msg__bubble {
  padding: 8px 12px;
  border-radius: 14px;
  border-bottom-left-radius: 4px;
  background: var(--surface-hover);
  border: 1px solid var(--border);
  font-size: 13.5px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}
.msg--mine .msg__bubble {
  background: var(--accent-grad);
  border-color: transparent;
  color: #fff;
  border-bottom-left-radius: 14px;
  border-bottom-right-radius: 4px;
}
.msg__meta { margin-top: 3px; font-size: 10.5px; color: var(--text-faint); }

.chat-input {
  display: flex;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}
.chat-input input { flex: 1; }
.chat-input .btn { height: 36px; width: 40px; }

/* Chat-FAB auf Mobil etwas kleiner */
@media (max-width: 640px) {
  .chat-panel { right: 10px; left: 10px; width: auto; bottom: 100px; }
  .upload-panel { right: 10px; left: 10px; bottom: 100px; }
}

/* =========================================================================
   Eigenes Dropdown (immer dunkel, unabhängig vom System-Theme)
   ========================================================================= */

.dropdown-select { position: relative; width: 100%; }
.sort .dropdown-select { width: auto; min-width: 122px; }

.dropdown-select__btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  height: 36px;
  padding: 0 11px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 13.5px;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}
.dropdown-select__btn:hover { background: var(--surface-hover); border-color: var(--border-strong); }
.dropdown-select__btn svg { width: 16px; height: 16px; color: var(--text-dim); flex-shrink: 0; }

.dropdown-select__menu {
  position: absolute;
  z-index: 85;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  padding: 6px;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  background: var(--panel-solid);
  box-shadow: var(--shadow);
  animation: pop .12s ease;
}
.dropdown-select__item {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 8px 10px;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 13.5px;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
}
.dropdown-select__item:hover { background: var(--surface-hover); }
.dropdown-select__item.is-active { background: var(--accent-soft); color: var(--accent-2); font-weight: 600; }

/* Fallback für evtl. noch vorhandene native Selects */
.select, select, option {
  color-scheme: dark;
  background-color: #10121c;
  color: #e9ecf6;
}

