/* ImagicX: Nutzer- und Adminbereich (Seitenleiste, Dashboard, Profil, Galerien) */

/* Rahmen */
.user-area-wrapper {
  min-height: calc(100vh - 72px);
}

.user-main-content {
  flex-grow: 1;
  min-width: 0;
  padding: 2rem 2.5rem;
}

.user-main-content > .container,
.user-main-content > section > .container,
.user-main-content > section > .container-fluid {
  max-width: none;
  padding-inline: 0;
}

.user-main-content > section.py-5,
.user-main-content > section > .container.py-5,
.user-main-content > section > .container-fluid.py-3 {
  padding-block: 0 !important;
}

.user-main-content section.py-5:not(:first-of-type) { border-top: none; }

.user-main-content .dataTables_wrapper { overflow-x: auto; }
.user-main-content .dataTables_wrapper > .table,
.user-main-content .dataTables_wrapper .dataTables_scroll { min-width: 0; }
.user-main-content table.dataTable { width: 100% !important; }

/* Lange Links im Aktivitaets-Log umbrechen statt abschneiden */
.user-main-content .table td .text-muted.small { overflow-wrap: anywhere; }

@media (max-width: 768px) {
  .user-main-content {
    padding: 1.25rem 0.75rem;
  }
}

/* Seitenleiste */
.user-sidebar {
  width: 280px;
  background-color: rgba(17, 22, 25, 0.75);
  backdrop-filter: blur(12px);
  border-right: 1px solid var(--ix-line-soft);
  padding: 1.5rem 1rem;
  transition: all 0.3s ease;
}

.sidebar-user-card {
  padding: 0.9rem 1rem;
  background: var(--ix-raised);
  border: 1px solid var(--ix-line-soft);
  border-radius: var(--ix-radius);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.sidebar-user-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 2px solid var(--ix-safelight);
  object-fit: cover;
  flex-shrink: 0;
}

.sidebar-user-info {
  min-width: 0;
  flex-grow: 1;
}

.sidebar-user-name {
  font-family: Chivo, sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--ix-paper);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 0.15rem;
}

.sidebar-user-meta {
  font-size: 0.75rem;
  color: var(--ix-muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.status-indicator-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: #22c55e;
  box-shadow: 0 0 8px #22c55e;
  display: inline-block;
}

.sidebar-section-title {
  font-size: 0.78rem;
  letter-spacing: 0.01em;
  color: var(--ix-muted);
  padding: 0.5rem 0.75rem 0.25rem;
  margin-top: 0.75rem;
  font-weight: 600;
}

.sidebar-nav {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.sidebar-nav .nav-link {
  display: flex;
  align-items: center;
  padding: 0.65rem 0.9rem;
  color: var(--ix-muted);
  font-family: Chivo, sans-serif;
  font-size: 0.92rem;
  font-weight: 500;
  border-radius: var(--ix-radius);
  border-left: 3px solid transparent;
  transition: all 0.2s ease;
  text-decoration: none;
}

.sidebar-nav .nav-link i {
  width: 20px;
  font-size: 1.05rem;
  margin-right: 0.75rem;
  color: var(--ix-muted);
  transition: color 0.2s ease, transform 0.2s ease;
  text-align: center;
}

.sidebar-nav .nav-link:hover {
  color: var(--ix-paper);
  background-color: rgba(255, 255, 255, 0.04);
  border-left-color: rgba(53, 200, 240, 0.5);
}

.sidebar-nav .nav-link:hover i {
  color: var(--ix-safelight);
  transform: translateX(2px);
}

.sidebar-nav .nav-link.active {
  color: #fff;
  background-color: var(--ix-safelight-soft);
  border-left-color: var(--ix-safelight);
  font-weight: 600;
}

.sidebar-nav .nav-link.active i {
  color: var(--ix-safelight);
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid var(--ix-line-soft);
}

/* Auf- und zuklappbare Seitenleiste fuer kleine Bildschirme */
.sidebar-toggle {
  display: none;
  width: 100%;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.85rem;
  background: var(--ix-raised);
  border: 1px solid var(--ix-line-soft);
  border-radius: var(--ix-radius);
  color: var(--ix-paper);
  text-align: left;
}

.sidebar-toggle-text {
  min-width: 0;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.sidebar-toggle-current {
  font-size: 0.78rem;
  color: var(--ix-safelight);
  letter-spacing: 0.04em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-toggle-caret {
  color: var(--ix-muted);
  font-size: 0.85rem;
  transition: transform 0.2s ease;
}

.sidebar-toggle[aria-expanded="true"] .sidebar-toggle-caret {
  transform: rotate(180deg);
}

@media (max-width: 991.98px) {
  .user-sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--ix-line-soft);
    padding: 0.75rem;
    position: sticky;
    top: 0;
    z-index: 1030;
    background-color: rgba(8, 10, 12, 0.96);
  }

  .sidebar-toggle { display: flex; }
  .sidebar-body { margin-top: 0.75rem; }
  .sidebar-nav .nav-link { padding-block: 0.8rem; }
  .sidebar-section-title { padding-top: 0.25rem; }
}

/* Kopfkarte im Nutzerbereich */
.user-hero-card {
  position: relative;
  background: linear-gradient(135deg, rgba(23, 30, 35, 0.9) 0%, rgba(17, 22, 25, 0.95) 100%);
  border: 1px solid var(--ix-line);
  border-radius: var(--ix-radius);
  padding: 2rem;
  margin-bottom: 2rem;
  overflow: hidden;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
}

.user-hero-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--ix-prism);
}

.user-hero-title {
  font-family: Chivo, sans-serif;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-size: 1.75rem;
  line-height: 1.1;
  color: var(--ix-paper);
  margin-bottom: 0.35rem;
}

@media (max-width: 991.98px) {
  .user-hero-card { padding: 1.25rem; margin-bottom: 1.25rem; }
  .user-hero-title { font-size: 1.4rem; }
}

/* Kennzahlen */
.ix-stat-card {
  background-color: var(--ix-surface);
  border: 1px solid var(--ix-line-soft);
  border-radius: var(--ix-radius);
  padding: 1.35rem 1.25rem;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  overflow: hidden;
  height: 100%;
}

.ix-stat-card:hover {
  transform: translateY(-2px);
  border-color: var(--ix-line);
  box-shadow: 0 8px 25px -8px rgba(0, 0, 0, 0.5);
}

.ix-stat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
}

.ix-stat-label {
  font-size: 0.84rem;
  letter-spacing: 0.01em;
  color: var(--ix-muted);
  font-weight: 600;
}

.ix-stat-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--ix-radius);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--ix-line-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  color: var(--ix-safelight);
}

.ix-stat-value {
  font-family: Chivo, sans-serif;
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--ix-paper);
  line-height: 1.1;
  margin-bottom: 0.35rem;
}

.ix-stat-subtext {
  font-size: 0.8rem;
  color: var(--ix-muted);
}

@media (max-width: 575.98px) {
  /* Zu zweit nebeneinander */
  .row > .col-sm-6.col-xl-3:has(> .ix-stat-card) { flex: 0 0 50%; max-width: 50%; }
  .ix-stat-card { padding: 1rem 0.9rem; }
  .ix-stat-header { margin-bottom: 0.6rem; align-items: flex-start; gap: 0.5rem; }
  .ix-stat-icon { width: 32px; height: 32px; font-size: 0.95rem; flex-shrink: 0; }
  .ix-stat-value { font-size: 1.55rem; }
  .ix-stat-label { font-size: 0.8rem; line-height: 1.3; }
}

/* Schnellzugriffe */
.quick-action-card {
  background: var(--ix-surface);
  border: 1px solid var(--ix-line-soft);
  border-radius: var(--ix-radius);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  text-decoration: none;
  color: var(--ix-paper);
  transition: all 0.2s ease;
}

.quick-action-card:hover {
  background: var(--ix-raised);
  border-color: var(--ix-safelight);
  color: var(--ix-paper);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px -6px rgba(53, 200, 240, 0.2);
}

.quick-action-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--ix-radius);
  background: var(--ix-safelight-soft);
  border: 1px solid rgba(53, 200, 240, 0.25);
  color: var(--ix-safelight);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.quick-action-content h6 {
  margin-bottom: 0.2rem;
  font-size: 0.95rem;
  font-weight: 600;
}

.quick-action-content p {
  margin-bottom: 0;
  font-size: 0.8rem;
  color: var(--ix-muted);
}

@media (max-width: 575.98px) {
  /* Als 2x2-Raster */
  .row > .col-12.col-sm-6:has(> .quick-action-card) { flex: 0 0 50%; max-width: 50%; }
  .quick-action-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.9rem;
    height: 100%;
  }
  .quick-action-icon { width: 38px; height: 38px; font-size: 1.05rem; }
  .quick-action-content h6 { font-size: 0.9rem; }
  .quick-action-content p, .quick-action-content small { font-size: 0.78rem; }
}

/* Profil */
.profileimage {
  width: 96px;
  height: 96px;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid var(--ix-safelight, #35c8f0);
  box-shadow: 0 0 20px rgba(53, 200, 240, 0.2);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.profileimage:hover {
  transform: scale(1.03);
  box-shadow: 0 0 25px rgba(53, 200, 240, 0.35);
}

.profile-detail-card {
  background-color: var(--ix-surface);
  border: 1px solid var(--ix-line-soft);
  border-radius: var(--ix-radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.profile-detail-card:hover {
  border-color: var(--ix-line);
}

.detail-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--ix-line-soft);
}

.detail-item-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.detail-item-row:first-child {
  padding-top: 0;
}

.detail-item-label {
  color: var(--ix-muted);
  font-size: 0.8rem;
  letter-spacing: 0.01em;
  font-weight: 600;
}

.detail-item-value {
  color: var(--ix-paper);
  font-size: 0.98rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-detail-action {
  width: 32px;
  height: 32px;
  border-radius: var(--ix-radius);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--ix-line);
  color: var(--ix-paper);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-size: 0.82rem;
  transition: all 0.2s ease;
}

.btn-detail-action:hover {
  background: var(--ix-safelight-soft);
  border-color: var(--ix-safelight);
  color: var(--ix-safelight);
}

.danger-zone-card {
  background: rgba(214, 69, 69, 0.04);
  border: 1px solid rgba(214, 69, 69, 0.25);
  border-radius: var(--ix-radius);
  padding: 1.5rem;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.danger-zone-card:hover {
  background: rgba(214, 69, 69, 0.07);
  border-color: rgba(214, 69, 69, 0.45);
}

@media (max-width: 991.98px) {
  .profile-detail-card { padding: 1.1rem; margin-bottom: 1rem; }

  .profile-detail-card > .d-flex.justify-content-between {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .profile-detail-card h5 { font-size: 1rem; }

  .detail-item-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.3rem;
  }
}

/* Profil-Tabs: eine Leiste, bei Platzmangel seitlich wischbar */
.profile-tabs-card {
  position: relative;
  background: linear-gradient(135deg, rgba(23, 30, 35, 0.95) 0%, rgba(17, 22, 25, 0.98) 100%);
  border: 1px solid var(--ix-line);
  border-radius: var(--ix-radius);
  padding: 0.65rem 0.85rem;
  margin-bottom: 2rem;
  overflow: hidden;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
}

.profile-tabs-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--ix-prism);
}

.profile-tabs-nav {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.45rem;
  padding: 0;
  background: transparent;
  border: none;
  margin-bottom: 0;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.profile-tabs-nav::-webkit-scrollbar { display: none; }
.profile-tabs-nav .nav-item { flex: 0 0 auto; scroll-snap-align: start; }

.profile-tabs-nav .nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1.15rem;
  border-radius: var(--ix-radius);
  color: var(--ix-muted);
  font-weight: 500;
  font-size: 0.88rem;
  border: 1px solid transparent;
  transition: all 0.2s ease;
  background: rgba(255, 255, 255, 0.03);
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}

.profile-tabs-nav .nav-link:hover {
  color: var(--ix-paper);
  background: rgba(255, 255, 255, 0.07);
  border-color: var(--ix-line-soft);
}

.profile-tabs-nav .nav-link.active {
  color: #fff;
  background: var(--ix-raised);
  border-color: var(--ix-safelight);
  box-shadow: 0 4px 16px -4px rgba(53, 200, 240, 0.35);
}

.profile-tabs-nav .nav-link.active i {
  color: var(--ix-safelight);
}

/* Mit Maus ist Wischen nicht auffindbar: auf grossen Bildschirmen wieder umbrechen */
@media (min-width: 992px) {
  .profile-tabs-nav { flex-wrap: wrap; overflow-x: visible; }
  .profile-tabs-nav .nav-link { padding: 0.5rem 0.9rem; }
}

@media (max-width: 991.98px) {
  .profile-tabs-card { padding: 0.5rem; }
  .profile-tabs-nav .nav-link { padding: 0.55rem 0.9rem; }
}

/* Schritte in der 2FA-Einrichtung */
.ix-step-pill {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--ix-safelight-soft);
  color: var(--ix-safelight);
  border: 1px solid rgba(53, 200, 240, 0.3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.82rem;
  flex-shrink: 0;
}

.hideMe {
  display: none;
}

.logo-container {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-gap: 12px;
  margin-top: 15px;
}

.logo-box {
  text-align: center;
  padding: 12px 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--ix-line-soft);
  border-radius: var(--ix-radius);
  transition: all 0.2s ease;
}

.logo-box:hover {
  border-color: var(--ix-safelight);
  background: var(--ix-safelight-soft);
}

.logo-box img {
  width: 48px;
  height: 48px;
  margin-bottom: 6px;
}

.logo-box p {
  font-size: 0.8rem;
  margin-bottom: 0;
  color: var(--ix-paper);
}

/* Galerie */
.gallery-toolbar {
  background: var(--ix-surface);
  border: 1px solid var(--ix-line-soft);
  border-radius: var(--ix-radius);
  padding: 0.75rem 1rem;
  margin-bottom: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

/* Sortierauswahl nicht abschneiden, Label und Auswahl bleiben in einer Zeile */
.gallery-toolbar .input-group { flex-wrap: nowrap; }
.gallery-toolbar .form-select { min-width: 11rem; }

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.25rem;
}

.gallery-card {
  background: var(--ix-surface);
  border: 1px solid var(--ix-line-soft);
  border-radius: var(--ix-radius);
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.gallery-card:hover {
  transform: translateY(-3px);
  border-color: var(--ix-safelight);
  box-shadow: 0 10px 25px -8px rgba(0, 0, 0, 0.6);
}

.gallery-card-thumb {
  position: relative;
  aspect-ratio: 16 / 10;
  background: #06080a;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-card-thumb canvas,
.gallery-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gallery-card-thumb .copy-protection {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  background: transparent;
  pointer-events: none;
}

.gallery-card-thumb .loading-spinner,
.gallery-card-thumb .loading-error {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 140px;
}

.gallery-card-checkbox {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 15;
  background: rgba(8, 10, 12, 0.75);
  backdrop-filter: blur(4px);
  border: 1px solid var(--ix-line-soft);
  border-radius: 6px;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.gallery-card-checkbox:hover {
  border-color: var(--ix-safelight);
}

.gallery-card-checkbox input {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--ix-safelight);
}

.gallery-card-ext {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 15;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  font-weight: 700;
  text-transform: uppercase;
  background: rgba(8, 10, 12, 0.75);
  backdrop-filter: blur(4px);
  border: 1px solid var(--ix-line-soft);
  color: var(--ix-safelight);
  padding: 2px 7px;
  border-radius: 4px;
}

.gallery-card-hover {
  position: absolute;
  inset: 0;
  background: rgba(8, 10, 12, 0.75);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 10;
}

.gallery-card:hover .gallery-card-hover {
  opacity: 1;
}

.gallery-card-hover .btn-action {
  width: 36px;
  height: 36px;
  border-radius: var(--ix-radius);
  background: var(--ix-raised);
  border: 1px solid var(--ix-line);
  color: var(--ix-paper);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  transition: all 0.2s ease;
  text-decoration: none;
}

.gallery-card-hover .btn-action:hover {
  background: var(--ix-safelight-soft);
  border-color: var(--ix-safelight);
  color: var(--ix-safelight);
  transform: scale(1.08);
}

.gallery-card-hover .btn-action.btn-action-danger:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: #ef4444;
  color: #f87171;
}

.gallery-card-body {
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  background: var(--ix-surface);
  border-top: 1px solid var(--ix-line-soft);
}

.gallery-card-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.gallery-card-title code {
  color: var(--ix-paper);
  font-size: 0.85rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gallery-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--ix-muted);
}

.floating-batch-bar {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  z-index: 1050;
  background: rgba(17, 22, 25, 0.95);
  backdrop-filter: blur(12px);
  border: 1px solid var(--ix-safelight);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6), 0 0 20px -5px rgba(53, 200, 240, 0.3);
  border-radius: 50px;
  padding: 0.5rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
  opacity: 0;
  pointer-events: none;
}

.floating-batch-bar.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.ix-pagination .page-link {
  background-color: var(--ix-surface);
  border-color: var(--ix-line-soft);
  color: var(--ix-paper);
  padding: 0.45rem 0.85rem;
  font-size: 0.85rem;
  transition: all 0.2s ease;
}

.ix-pagination .page-link:hover {
  background-color: var(--ix-raised);
  border-color: var(--ix-safelight);
  color: var(--ix-safelight);
}

.ix-pagination .page-item.active .page-link {
  background-color: var(--ix-safelight);
  border-color: var(--ix-safelight);
  color: #080a0c;
  font-weight: 600;
}

.ix-pagination .page-item.disabled .page-link {
  background-color: var(--ix-surface);
  border-color: var(--ix-line-soft);
  color: var(--ix-muted);
  opacity: 0.5;
}

@media (max-width: 991.98px) {
  .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0.75rem; }

  .gallery-toolbar { padding: 0.75rem; gap: 0.75rem; }
  .gallery-toolbar form { flex-wrap: wrap; width: 100%; }
  .gallery-toolbar form .input-group { max-width: none !important; width: 100% !important; }
  .gallery-toolbar > .d-flex { width: 100%; justify-content: space-between; }

  .floating-batch-bar {
    left: 0.75rem;
    right: 0.75rem;
    bottom: 0.75rem;
    transform: translateY(120px);
    border-radius: var(--ix-radius);
    padding: 0.7rem 0.85rem;
    flex-wrap: wrap;
    gap: 0.6rem;
    justify-content: space-between;
  }

  .floating-batch-bar.show { transform: translateY(0); }
}

@media (max-width: 575.98px) {
  /* Titel und Metadaten sauber umbrechen */
  .gallery-card-body { padding: 0.7rem; }
  .gallery-card-title { flex-wrap: wrap; gap: 0.25rem 0.5rem; }
  .gallery-card-title code { font-size: 0.78rem; max-width: 100%; }
  .gallery-card-meta { flex-wrap: wrap; gap: 0.2rem 0.6rem; font-size: 0.74rem; }
}

@media (hover: none) and (pointer: coarse) {
  .gallery-card:hover { transform: none; }
}

/* Hochladen aus der Galerie */
.gallery-upload-drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 2rem 1rem;
  border: 1px dashed var(--ix-line);
  border-radius: var(--ix-radius);
  background: rgba(0, 0, 0, 0.25);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.gallery-upload-drop i { font-size: 2rem; color: var(--ix-safelight); margin-bottom: 0.35rem; }
.gallery-upload-drop-title { color: var(--ix-paper); font-weight: 600; }
.gallery-upload-drop-hint { color: var(--ix-muted); font-size: 0.82rem; }

.gallery-upload-drop:hover,
.gallery-upload-drop.is-dragover,
.gallery-upload-drop:focus-within {
  border-color: var(--ix-safelight);
  background: var(--ix-safelight-soft);
}

.gallery-upload-list {
  list-style: none;
  margin: 0.9rem 0 0;
  padding: 0;
  max-height: 14rem;
  overflow-y: auto;
}

.gallery-upload-list li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--ix-line-soft);
  font-size: 0.88rem;
}

.gallery-upload-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ix-paper); }
.gallery-upload-meta { flex: 0 0 auto; color: var(--ix-muted); font-size: 0.8rem; }
.gallery-upload-list li.is-invalid .gallery-upload-meta { color: #ff6b6b; }

.gallery-upload-remove {
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  color: var(--ix-muted);
  padding: 0.2rem 0.35rem;
  line-height: 1;
}

.gallery-upload-remove:hover,
.gallery-upload-remove:focus-visible { color: #ff6b6b; }

.gallery-upload-retention {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1rem;
  color: var(--ix-muted);
  font-size: 0.88rem;
}

.gallery-upload-retention .input-group { width: 8.5rem; }

/* Admin: Kennzahlen- und Tabellenkarten */
.magic_black {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  word-wrap: break-word;
  background-clip: border-box;
}

.magic_admin {
  height: 150px;
}

.magic_black .card-title {
  font-size: 0.78rem;
  letter-spacing: 0.01em;
  color: var(--ix-muted) !important;
}

.magic_black .card-body h2 { color: var(--ix-paper) !important; }
.magic_black .table { color: var(--ix-muted); }
.magic_black .table strong { color: var(--ix-paper); font-weight: 600; }
.magic_black h6.text-uppercase { text-transform: none !important; letter-spacing: 0.01em; }

/* Admin-Dashboard: Upload-Verlauf, Meldungen, Ablauf und Cleanup */
.admin-upload-chart { position: relative; height: 240px; }

.admin-report-list { list-style: none; margin: 0; padding: 0; }
.admin-report-list li { padding: 0.6rem 0; border-bottom: 1px solid var(--ix-line-soft); }
.admin-report-list li:first-child { padding-top: 0; }
.admin-report-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.admin-report-image { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.88rem; }

.admin-kv { display: flex; justify-content: space-between; gap: 1rem; padding: 0.3rem 0; font-size: 0.9rem; }
.admin-kv > :last-child { text-align: right; }

@media (max-width: 767.98px) {
  /* Kennzahlen zu zweit nebeneinander */
  .user-main-content .row > .col-lg-3.col-md-6:has(> .magic_black) { flex: 0 0 50%; max-width: 50%; }
  .magic_black h2 { font-size: 1.6rem; }
  .magic_black .fa-3x { font-size: 1.6em; }
}

@media (max-width: 575.98px) {
  /* Breite Inhalte seitlich scrollen statt abschneiden */
  .magic_black .card-body { overflow-x: auto; }
}

/* Admin: Bildtabellen (alle Bilder, anonyme Bilder) */
.gallery_pic-wrapper {
  width: 170px;
}

#images .protected-image-container {
  position: relative;
  width: 175px;
  height: 160px;
  padding: 6px;
  background-color: #404040;
  background-clip: border-box;
  border-radius: 20px 20px 0px 0px;
  overflow: hidden;
}

#images .canvas-container {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

#images .canvas-container canvas {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

#images .image-overlay,
#images .copy-protection {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: transparent;
  z-index: 10;
  cursor: default;
  pointer-events: auto;
}

#images .loading-spinner,
#images .loading-error {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 100px;
}

#images .loading-spinner i {
  color: #0d6efd;
}

#images .loading-error i {
  color: #dc3545;
  font-size: 2rem;
}

/* Profil: vollstaendiges Aktivitaetsprotokoll */
.activity-log { max-height: 32rem; overflow-y: auto; }
.activity-log thead th { position: sticky; top: 0; background: var(--ix-surface); z-index: 1; }
.activity-log td.small { overflow-wrap: anywhere; }
