:root {
  --bg-0: #140708;
  --bg-1: #24090b;
  --text: #fdeaea;
  --muted: #d29a9a;
  --accent: #db0000;
  --accent-hi: #ff2a2a;
  --accent-2: #a30000;
  --danger: #ff5a5a;
  --glass-bg: rgba(255, 255, 255, 0.06);
  --glass-brd: rgba(255, 255, 255, 0.14);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
  --radius: 18px;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: radial-gradient(1200px 800px at 15% -10%, #5c0808 0%, transparent 60%),
              radial-gradient(1000px 700px at 110% 10%, #7a0000 0%, transparent 55%),
              linear-gradient(160deg, var(--bg-0), var(--bg-1));
  background-attachment: fixed;
  min-height: 100%;
  overflow-x: hidden;
}

/* schwebende Farb-Orbs im Hintergrund */
.bg-orbs { position: fixed; inset: 0; z-index: -1; overflow: hidden; }
.orb { position: absolute; border-radius: 50%; filter: blur(70px); opacity: 0.5; }
.orb-1 { width: 420px; height: 420px; background: #db0000; top: -80px; left: -60px; }
.orb-2 { width: 380px; height: 380px; background: #8a0000; bottom: -100px; right: -40px; }
.orb-3 { width: 300px; height: 300px; background: #ff4d4d; top: 40%; left: 55%; opacity: 0.28; }

.glass {
  background: var(--glass-bg);
  border: 1px solid var(--glass-brd);
  box-shadow: var(--glass-shadow);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border-radius: var(--radius);
}

.muted { color: var(--muted); }
.small { font-size: 0.82rem; }

/* ---------- Login ---------- */
.center-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.card-login { width: 100%; max-width: 380px; padding: 34px 30px; }
.brand { text-align: center; margin-bottom: 22px; }
.brand-mark {
  display: inline-block;
  width: 66px; height: 66px;
  margin: 0 auto 12px;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 6px 20px rgba(219, 0, 0, 0.4);
}
.brand-mark img { width: 100%; height: 100%; display: block; }
.brand-mark.small { width: 40px; height: 40px; margin: 0; border-radius: 11px; }
.brand h1 { margin: 6px 0 2px; font-size: 1.4rem; }

.field { display: block; margin-bottom: 16px; }
.field span { display: block; font-size: 0.82rem; color: var(--muted); margin-bottom: 6px; }
.field input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--glass-brd);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(219, 0, 0, 0.28);
}

.btn {
  cursor: pointer;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 10px 16px;
  font-size: 0.9rem;
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  transition: transform 0.05s, background 0.15s, border-color 0.15s;
}
.btn:hover { background: rgba(255, 255, 255, 0.14); }
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: linear-gradient(135deg, var(--accent-hi), var(--accent-2));
  color: #fff; font-weight: 600; border: none;
}
.btn-primary:hover { filter: brightness(1.08); }
.btn-block { width: 100%; margin-top: 6px; }
.btn-ghost { background: transparent; border-color: var(--glass-brd); }
.btn-danger { background: rgba(255, 107, 129, 0.16); border-color: rgba(255,107,129,0.4); color: #ffd0d8; }
.btn-danger:hover { background: rgba(255, 107, 129, 0.28); }
.btn-sm { padding: 6px 10px; font-size: 0.8rem; }
.link { background: none; border: none; color: var(--accent-hi); cursor: pointer; padding: 0; font: inherit; }

.alert { padding: 10px 14px; border-radius: 12px; margin-bottom: 14px; font-size: 0.88rem; }
.alert-error, .alert-danger { background: rgba(255, 107, 129, 0.15); border: 1px solid rgba(255,107,129,0.35); }
.alert-success { background: rgba(64, 220, 150, 0.14); border: 1px solid rgba(64,220,150,0.35); }

/* ---------- App / Dashboard ---------- */
.app { max-width: 1200px; margin: 0 auto; padding: 22px 20px 60px; }
.topbar {
  display: flex; align-items: center; gap: 16px;
  padding: 12px 16px; margin-bottom: 18px;
}
.topbar-brand { display: flex; align-items: center; gap: 12px; }
.topbar-brand > div { display: flex; flex-direction: column; line-height: 1.15; }
.search { flex: 1; }
.search input {
  width: 100%; padding: 11px 16px; border-radius: 12px;
  border: 1px solid var(--glass-brd); background: rgba(255,255,255,0.06);
  color: var(--text); outline: none; font-size: 0.92rem;
}
.search input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(219,0,0,0.25); }
.logout-form { margin: 0; }

.messages { margin-bottom: 16px; }

/* Dropzone */
.dropzone { padding: 26px; margin-bottom: 22px; text-align: center; transition: border-color 0.15s, background 0.15s; }
.dropzone.dragover { border-color: var(--accent); background: rgba(219,0,0,0.12); }
.dz-icon { font-size: 30px; margin-bottom: 6px; }
.dropzone-inner p { margin: 4px 0; }
.dz-selected { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; }
#dz-count { font-weight: 600; }

/* Grid */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}
.card.asset { padding: 0; overflow: hidden; display: flex; flex-direction: column; position: relative; }
.card.asset.inactive { opacity: 0.55; }
.thumb {
  height: 150px; display: grid; place-items: center; overflow: hidden;
  background-color: #e9e9ee;
  background-image:
    linear-gradient(45deg, #cfcfd6 25%, transparent 25%),
    linear-gradient(-45deg, #cfcfd6 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #cfcfd6 75%),
    linear-gradient(-45deg, transparent 75%, #cfcfd6 75%);
  background-size: 18px 18px;
  background-position: 0 0, 0 9px, 9px -9px, -9px 0;
}
.thumb img { width: 100%; height: 100%; object-fit: contain; cursor: zoom-in; padding: 6px; }
.filetype {
  font-size: 0.8rem; color: var(--muted); padding: 8px 12px;
  border: 1px dashed var(--glass-brd); border-radius: 10px; max-width: 90%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.asset-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 8px; }
.asset-name { font-weight: 600; font-size: 0.92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge {
  display: inline-block; padding: 1px 7px; border-radius: 999px;
  background: rgba(255,107,129,0.2); border: 1px solid rgba(255,107,129,0.4); font-size: 0.72rem;
}
.link-row { display: flex; gap: 6px; }
.link-input {
  flex: 1; min-width: 0; padding: 7px 10px; font-size: 0.76rem;
  border-radius: 10px; border: 1px solid var(--glass-brd);
  background: rgba(0,0,0,0.25); color: var(--muted);
}
.btn-copy { white-space: nowrap; }
.btn-copy.copied { background: rgba(64,220,150,0.22); border-color: rgba(64,220,150,0.4); color: #c7ffe4; }
.asset-actions { display: flex; gap: 8px; justify-content: space-between; }

/* ---------- Modal (SweetAlert-Stil, self-contained) ---------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  background: rgba(10, 2, 3, 0.6);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  opacity: 0; pointer-events: none;
  transition: opacity 0.18s ease;
}
.modal-overlay.open { opacity: 1; pointer-events: auto; }
.modal {
  width: 100%; max-width: 400px; padding: 28px 26px; text-align: center;
  transform: scale(0.94); transition: transform 0.18s ease;
}
.modal-overlay.open .modal { transform: scale(1); }
.modal-icon {
  width: 58px; height: 58px; margin: 0 auto 14px;
  display: grid; place-items: center; border-radius: 50%;
  font-size: 30px; line-height: 1;
  background: rgba(219, 0, 0, 0.16);
  border: 2px solid rgba(219, 0, 0, 0.5);
  color: var(--accent-hi);
}
.modal h2 { margin: 0 0 6px; font-size: 1.2rem; }
.modal p { margin: 0 0 20px; color: var(--muted); font-size: 0.9rem; word-break: break-word; }
.modal-actions { display: flex; gap: 10px; justify-content: center; }
.modal-actions .btn { min-width: 110px; }

.empty { text-align: center; padding: 50px 20px; grid-column: 1 / -1; }

@media (max-width: 640px) {
  .topbar { flex-wrap: wrap; }
  .search { order: 3; flex-basis: 100%; }
}

/* ---------- Navigation ---------- */
.topnav { display: flex; gap: 6px; }
.topnav.grow { flex: 1; }
.navlink {
  padding: 8px 14px; border-radius: 10px; text-decoration: none;
  color: var(--muted); font-size: 0.9rem; transition: background 0.15s, color 0.15s;
}
.navlink:hover { background: rgba(255,255,255,0.08); color: var(--text); }
.navlink.active { background: rgba(219,0,0,0.18); color: #fff; border: 1px solid rgba(219,0,0,0.4); }

/* ---------- Section-Head ---------- */
.section-head {
  display: flex; align-items: center; justify-content: space-between;
  margin: 4px 2px 14px; gap: 12px; flex-wrap: wrap;
}
.section-head h2 { margin: 0; font-size: 1.15rem; }
.filter-form select {
  padding: 9px 14px; border-radius: 10px; border: 1px solid var(--glass-brd);
  background: rgba(0,0,0,0.3); color: var(--text); outline: none; font-size: 0.88rem;
}

/* ---------- Tabellen ---------- */
.table-wrap { padding: 6px; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.data-table th, .data-table td { text-align: left; padding: 11px 14px; border-bottom: 1px solid rgba(255,255,255,0.07); }
.data-table th { color: var(--muted); font-weight: 600; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.03em; }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: rgba(255,255,255,0.03); }
.data-table .nowrap { white-space: nowrap; }
.data-table .ellip { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-actions { display: flex; gap: 8px; justify-content: flex-end; }

.status-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 5px; vertical-align: middle; }
.status-dot.on { background: #40dc96; box-shadow: 0 0 6px rgba(64,220,150,0.7); }
.status-dot.off { background: #ff6b6b; }

/* ---------- Log-Tags ---------- */
.tag { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 0.76rem; background: rgba(255,255,255,0.1); border: 1px solid var(--glass-brd); }
.tag-upload { background: rgba(64,220,150,0.16); border-color: rgba(64,220,150,0.4); }
.tag-delete, .tag-user_delete { background: rgba(255,90,90,0.18); border-color: rgba(255,90,90,0.45); }
.tag-user_create { background: rgba(110,168,254,0.16); border-color: rgba(110,168,254,0.4); }
.tag-login { background: rgba(219,0,0,0.16); border-color: rgba(219,0,0,0.4); }

/* ---------- Modal-Formfelder ---------- */
.field.left { text-align: left; margin-bottom: 14px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 0.85rem; color: var(--muted); margin: 4px 0 18px; text-align: left; }
.check input { width: auto; }

/* ---------- Konto-Formular ---------- */
.card-form { max-width: 440px; padding: 26px 28px; }
.card-form .btn-primary { width: 100%; margin-top: 6px; }
.field-err { color: var(--danger); font-size: 0.78rem; margin-top: 5px; }

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(8, 2, 3, 0.82);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center; padding: 30px;
  opacity: 0; pointer-events: none; transition: opacity 0.2s ease;
}
.lightbox.open { opacity: 1; pointer-events: auto; }
.lb-close {
  position: absolute; top: 18px; right: 24px; z-index: 3;
  width: 42px; height: 42px; border-radius: 50%; cursor: pointer;
  border: 1px solid var(--glass-brd); background: rgba(255,255,255,0.08);
  color: #fff; font-size: 26px; line-height: 1;
}
.lb-close:hover { background: rgba(255,255,255,0.16); }
.lb-inner {
  display: flex; gap: 18px; width: 100%; max-width: 1150px; height: 82vh;
}
.lb-stage {
  flex: 1; position: relative; border-radius: var(--radius); overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  background-color: #e9e9ee;
  background-image:
    linear-gradient(45deg, #cfcfd6 25%, transparent 25%),
    linear-gradient(-45deg, #cfcfd6 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #cfcfd6 75%),
    linear-gradient(-45deg, transparent 75%, #cfcfd6 75%);
  background-size: 26px 26px;
  background-position: 0 0, 0 13px, 13px -13px, -13px 0;
}
.lb-img {
  max-width: 92%; max-height: 92%; object-fit: contain;
  transition: transform 0.12s ease; transform-origin: center center;
}
.lb-zoom {
  position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 6px; padding: 6px;
  background: rgba(20,7,8,0.6); border-radius: 12px;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.lb-zoom .btn { min-width: 46px; }
.lb-side {
  width: 320px; flex-shrink: 0; padding: 22px; display: flex; flex-direction: column; gap: 14px;
  align-self: stretch;
}
.lb-name { margin: 0; font-size: 1.05rem; word-break: break-word; }
.lb-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.lb-actions .btn { width: 100%; text-align: center; text-decoration: none; }

@media (max-width: 760px) {
  .lb-inner { flex-direction: column; height: 88vh; }
  .lb-side { width: auto; }
  .lb-stage { flex: 1; }
}

/* ---------- PDF: Thumbnail + Lightbox-Viewer ---------- */
.thumb-pdf { background: #fff; padding: 0 !important; object-fit: cover; object-position: top center; }
.lb-pdf {
  width: 100%; height: 100%; border: 0; border-radius: var(--radius);
  background: #fff;
}

/* ---------- Tags / Chips ---------- */
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 4px 2px 10px; border-radius: 999px; font-size: 0.76rem;
  background: rgba(219,0,0,0.16); border: 1px solid rgba(219,0,0,0.4); color: #ffd7d7;
}
.chip-x {
  border: none; background: none; color: inherit; cursor: pointer;
  font-size: 1rem; line-height: 1; padding: 0 3px; border-radius: 50%; opacity: 0.7;
}
.chip-x:hover { opacity: 1; background: rgba(255,255,255,0.15); }
.chip-add {
  width: 24px; height: 24px; border-radius: 50%; cursor: pointer;
  border: 1px dashed var(--glass-brd); background: rgba(255,255,255,0.06);
  color: var(--muted); font-size: 1rem; line-height: 1; padding: 0;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.chip-add:hover { background: rgba(219,0,0,0.18); color: #fff; border-color: rgba(219,0,0,0.5); }
.chip-input {
  min-width: 90px; padding: 4px 8px; border-radius: 10px; font-size: 0.78rem;
  border: 1px solid var(--accent); background: rgba(0,0,0,0.3); color: var(--text); outline: none;
}

/* ---------- KI-Beschreibung ---------- */
.ai-desc-row { min-height: 4px; }
.ai-alt {
  font-size: 0.78rem; color: #ffd7d7; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; cursor: help;
}
.ai-describe-btn { width: 100%; }
.lb-ai {
  font-size: 0.85rem; color: var(--text); line-height: 1.5;
  max-height: 40vh; overflow-y: auto; white-space: pre-wrap;
  padding: 12px; border-radius: 12px; background: rgba(0,0,0,0.25);
  border: 1px solid var(--glass-brd);
}

/* ---------- KI-Beschreibung (Lightbox-Box) ---------- */
.ai-alt-box { font-size: 0.85rem; color: #ffd7d7; background: rgba(219,0,0,0.14); border: 1px solid rgba(219,0,0,0.32); border-radius: 10px; padding: 8px 10px; margin-bottom: 8px; }
.ai-desc-text { font-size: 0.86rem; line-height: 1.45; color: var(--text); margin: 0 0 8px; }
.ai-ocr { font-size: 0.78rem; color: var(--muted); }
.ai-ocr summary { cursor: pointer; }
.ai-ocr pre { white-space: pre-wrap; word-break: break-word; background: rgba(0,0,0,0.3); border-radius: 8px; padding: 8px; margin-top: 6px; font-size: 0.72rem; }

/* ---------- Paginierung ---------- */
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 16px; margin-top: 18px; flex-wrap: wrap; }
.pg-nav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pg-cur { font-size: 0.85rem; padding: 0 8px; }
.pg-size select { padding: 6px 10px; border-radius: 10px; border: 1px solid var(--glass-brd); background: rgba(0,0,0,0.3); color: var(--text); outline: none; font-size: 0.85rem; }
.pg-size label { display: inline-flex; align-items: center; gap: 6px; }

/* ---------- Select-Dropdown-Optionen (Popup lesbar machen) ---------- */
select { color-scheme: dark; }
select option,
select optgroup {
  background: #1b1113;
  color: #fdeaea;
}

/* ---------- Icon-Buttons in Karten-Aktionsleiste ---------- */
.asset-actions.icons { display: flex; gap: 8px; justify-content: flex-end; align-items: center; }
.icon-btn {
  display: inline-grid; place-items: center;
  width: 34px; height: 34px; padding: 0; cursor: pointer;
  border-radius: 10px; border: 1px solid var(--glass-brd);
  background: rgba(255,255,255,0.06); color: var(--text);
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.05s;
}
.icon-btn:hover { background: rgba(255,255,255,0.14); }
.icon-btn:active { transform: translateY(1px); }
.icon-btn.danger:hover { background: rgba(255,90,90,0.2); border-color: rgba(255,90,90,0.45); color: #ffd0d8; }
.icon-btn.copied { background: rgba(64,220,150,0.22); border-color: rgba(64,220,150,0.45); color: #c7ffe4; }
.icon-btn.copied svg { display: none; }
.icon-btn.copied::after { content: "✔"; font-size: 15px; }
.icon-btn svg { display: block; }

/* Tag-Zeile klein oben ueber dem Bild */
.card.asset .tag-row {
  position: absolute; top: 0; left: 0; right: 0; z-index: 3;
  padding: 8px; margin: 0; min-height: 0; gap: 5px;
  background: linear-gradient(to bottom, rgba(10,4,5,0.75) 0%, rgba(10,4,5,0.35) 70%, transparent 100%);
  border-radius: var(--radius) var(--radius) 0 0;
  pointer-events: none;
}
.card.asset .tag-row > * { pointer-events: auto; }
.card.asset .tag-row .chip { font-size: 0.72rem; padding: 1px 4px 1px 8px; }
.card.asset .tag-row .chip-add {
  width: 20px; height: 20px; font-size: 0.9rem;
  background: rgba(0,0,0,0.4); border-color: rgba(255,255,255,0.3);
}
.card.asset .tag-row .chip-input { background: rgba(0,0,0,0.6); }

/* ---------- Sanfter Seiten-Uebergang / Kachel-Einblendung ---------- */
@keyframes cardIn {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}
.grid .card.asset {
  animation: cardIn 0.32s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}
/* gestaffelt (die ersten Kacheln nacheinander) */
.grid .card.asset:nth-child(1)  { animation-delay: 0.00s; }
.grid .card.asset:nth-child(2)  { animation-delay: 0.03s; }
.grid .card.asset:nth-child(3)  { animation-delay: 0.06s; }
.grid .card.asset:nth-child(4)  { animation-delay: 0.09s; }
.grid .card.asset:nth-child(5)  { animation-delay: 0.12s; }
.grid .card.asset:nth-child(6)  { animation-delay: 0.15s; }
.grid .card.asset:nth-child(7)  { animation-delay: 0.18s; }
.grid .card.asset:nth-child(8)  { animation-delay: 0.21s; }
.grid .card.asset:nth-child(9)  { animation-delay: 0.24s; }
.grid .card.asset:nth-child(n+10) { animation-delay: 0.27s; }
/* Ausblenden beim Verlassen der Seite (Suche/Blaettern) */
body.navigating .grid { opacity: 0; transform: translateY(6px); transition: opacity 0.18s ease, transform 0.18s ease; }
@media (prefers-reduced-motion: reduce) {
  .grid .card.asset { animation: none; }
  body.navigating .grid { transition: none; }
}

/* ---------- AJAX-Grid-Uebergang ---------- */
#grid-wrap { transition: opacity 0.15s ease; }
#grid-wrap.grid-loading { opacity: 0.35; pointer-events: none; }

/* Abstand zwischen Paginierungsleiste und erster Bildreihe */
#grid-wrap .pagination { margin-bottom: 18px; }

/* ---------- Topbar ohne Suche: Nav rechtsbuendig, kein Springen ---------- */
.topbar .topnav { margin-left: auto; }

/* ---------- Suchleiste ueber dem Grid ---------- */
.toolbar { margin: 0 0 14px; }
.toolbar input[type="search"] {
  width: 100%; padding: 12px 18px; border-radius: 14px;
  border: 1px solid var(--glass-brd); background: rgba(255,255,255,0.06);
  color: var(--text); outline: none; font-size: 0.95rem;
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  box-shadow: var(--glass-shadow);
}
.toolbar input[type="search"]:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(219,0,0,0.25); }
.toolbar input[type="search"]::placeholder { color: var(--muted); }

/* =====================================================================
   LIGHTMODE — Hellgrau/Silber + Rot-Akzent
   ===================================================================== */
:root[data-theme="light"] {
  --bg-0: #eef0f3;
  --bg-1: #dfe3e8;
  --text: #24282e;
  --muted: #6b7280;
  --accent: #db0000;
  --accent-hi: #b00000;
  --accent-2: #8a0000;
  --danger: #d12f3f;
  --glass-bg: rgba(255, 255, 255, 0.72);
  --glass-brd: rgba(20, 20, 30, 0.12);
  --glass-shadow: 0 8px 28px rgba(60, 70, 90, 0.18);
}

/* Hintergrund hell: silbergrau mit dezentem Rot */
:root[data-theme="light"] body {
  background: radial-gradient(1200px 800px at 15% -10%, #ffdede 0%, transparent 55%),
              radial-gradient(1000px 700px at 110% 10%, #f3c9c9 0%, transparent 50%),
              linear-gradient(160deg, #f4f6f8, #d9dde3);
  color: var(--text);
}
:root[data-theme="light"] .orb-1 { background: #db0000; opacity: 0.16; }
:root[data-theme="light"] .orb-2 { background: #b0b6c0; opacity: 0.30; }
:root[data-theme="light"] .orb-3 { background: #ff8a8a; opacity: 0.14; }

/* Glas-Elemente: heller, mit feinem Rand statt Leuchten */
:root[data-theme="light"] .btn { background: rgba(20,20,30,0.05); color: var(--text); }
:root[data-theme="light"] .btn:hover { background: rgba(20,20,30,0.10); }
:root[data-theme="light"] .btn-ghost { background: transparent; border-color: var(--glass-brd); }
:root[data-theme="light"] .field input,
:root[data-theme="light"] .search input,
:root[data-theme="light"] .toolbar input[type="search"],
:root[data-theme="light"] .chip-input,
:root[data-theme="light"] .link-input { background: rgba(255,255,255,0.85); color: var(--text); }
:root[data-theme="light"] .muted { color: var(--muted); }

/* Nav-Links */
:root[data-theme="light"] .navlink { color: var(--muted); }
:root[data-theme="light"] .navlink:hover { background: rgba(20,20,30,0.06); color: var(--text); }
:root[data-theme="light"] .navlink.active { background: rgba(219,0,0,0.12); color: var(--accent); border-color: rgba(219,0,0,0.35); }

/* Icon-Buttons */
:root[data-theme="light"] .icon-btn { background: rgba(20,20,30,0.05); color: var(--text); }
:root[data-theme="light"] .icon-btn:hover { background: rgba(20,20,30,0.11); }

/* Thumbnails/Lightbox-Karo: helleres Schachbrett */
:root[data-theme="light"] .thumb,
:root[data-theme="light"] .lb-stage {
  background-color: #f2f3f5;
  background-image:
    linear-gradient(45deg, #e2e4e8 25%, transparent 25%),
    linear-gradient(-45deg, #e2e4e8 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #e2e4e8 75%),
    linear-gradient(-45deg, transparent 75%, #e2e4e8 75%);
}

/* Modal-/Lightbox-Overlay heller */
:root[data-theme="light"] .modal-overlay { background: rgba(180, 185, 195, 0.55); }
:root[data-theme="light"] .lightbox { background: rgba(210, 214, 220, 0.85); }

/* Dropdown-Optionen hell */
:root[data-theme="light"] select { color-scheme: light; }
:root[data-theme="light"] select option,
:root[data-theme="light"] select optgroup { background: #ffffff; color: #24282e; }

/* Tabellen (Log/Einstellungen) */
:root[data-theme="light"] .data-table th, 
:root[data-theme="light"] .data-table td { border-bottom-color: rgba(20,20,30,0.10); }
:root[data-theme="light"] .data-table tbody tr:hover { background: rgba(20,20,30,0.03); }

/* Tag-Overlay auf hell: heller Verlauf statt dunkel */
:root[data-theme="light"] .card.asset .tag-row {
  background: linear-gradient(to bottom, rgba(255,255,255,0.85) 0%, rgba(255,255,255,0.4) 70%, transparent 100%);
}
:root[data-theme="light"] .card.asset .tag-row .chip-add { background: rgba(255,255,255,0.7); border-color: rgba(20,20,30,0.2); }

/* AI-Beschreibungs-Box hell */
:root[data-theme="light"] .ai-alt-box { background: rgba(219,0,0,0.08); border-color: rgba(219,0,0,0.25); color: var(--accent-2); }
:root[data-theme="light"] .ai-ocr pre { background: rgba(20,20,30,0.05); }
:root[data-theme="light"] .link-input { color: var(--muted); }

/* Theme-Toggle: Sonne im Dark (klick->hell), Mond im Light (klick->dunkel) */
.theme-toggle .ic-moon { display: none; }
.theme-toggle .ic-sun { display: block; }
:root[data-theme="light"] .theme-toggle .ic-sun { display: none; }
:root[data-theme="light"] .theme-toggle .ic-moon { display: block; }

/* ---------- Globaler Drag&Drop-Overlay ---------- */
.global-drop {
  position: fixed; inset: 0; z-index: 500;
  display: flex; align-items: center; justify-content: center;
  background: rgba(10, 4, 5, 0.55);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  opacity: 0; pointer-events: none; transition: opacity 0.15s ease;
}
.global-drop.active { opacity: 1; pointer-events: auto; }
.global-drop-inner {
  border: 2.5px dashed var(--accent);
  border-radius: 22px;
  padding: 48px 64px; text-align: center;
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  box-shadow: var(--glass-shadow);
  color: var(--text);
  transform: scale(0.96); transition: transform 0.15s ease;
}
.global-drop.active .global-drop-inner { transform: scale(1); }
.gd-icon { font-size: 54px; line-height: 1; margin-bottom: 12px; color: var(--accent); }
.gd-text { font-size: 1.2rem; font-weight: 600; }
.gd-sub { margin-top: 4px; }
:root[data-theme="light"] .global-drop { background: rgba(150, 155, 165, 0.5); }

/* Lightmode: KI-Beschreibung lesbar */
:root[data-theme="light"] .ai-alt { color: var(--accent-2); }
:root[data-theme="light"] .lb-ai { background: rgba(20,20,30,0.04); border-color: var(--glass-brd); color: var(--text); }
:root[data-theme="light"] .ai-desc-text { color: var(--text); }
:root[data-theme="light"] .ai-ocr { color: var(--muted); }
:root[data-theme="light"] .ai-ocr pre { background: rgba(20,20,30,0.06); color: var(--text); }
