/* ========= Base ========= */
:root{
  --brand:#1a349b;
  --brand-hover:#2b46d6;
  --brand-active:#14236f;
  --accent:#ff0099;
  --text:#333;
  --bg:#f0f0f0;
  --panel:#fff;
  --header-height:80px;
  --sidebar-width:250px;
  --header-right-offset:0px;
}

html, body{
  margin:0;
  font-family: Arial, sans-serif;
  background-color: var(--bg);
  color: var(--text);
}

body{
  min-height:100vh;
  display:flex;
  flex-direction:column;
}

body.modal-open{
  overflow:hidden;
}

/* ========= Header ========= */
.header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  padding:0 24px;
  background-color: var(--brand);
  box-shadow:0 6px 18px rgba(26,52,155,0.28);
  position:fixed;
  top:0;
  left:0;
  width:100%;
  height:var(--header-height);
  z-index:1000;
}

.header-primary{
  display:flex;
  align-items:center;
  gap:16px;
  flex:1;
  min-width:0;
}

.header-logo{
  display:none;
  align-items:center;
  justify-content:center;
  flex-shrink:0;
}

.header-logo img{
  display:block;
  height:36px;
  width:auto;
}

.header-menu-toggle{
  display:none;
  align-items:center;
  justify-content:center;
  width:44px;
  height:44px;
  border:none;
  background:transparent;
  padding:0;
  cursor:pointer;
  color:#fff;
}

.header-menu-toggle:focus-visible{
  outline:2px solid #fff;
  outline-offset:2px;
}

.header-menu-icon{
  position:relative;
  display:block;
  width:22px;
  height:2px;
  background-color:currentColor;
  border-radius:1px;
  transition:background-color .2s ease;
}

.header-menu-icon::before,
.header-menu-icon::after{
  content:"";
  position:absolute;
  left:0;
  width:22px;
  height:2px;
  background-color:currentColor;
  border-radius:1px;
  transition:transform .2s ease;
}

.header-menu-icon::before{ transform:translateY(-6px); }
.header-menu-icon::after{ transform:translateY(6px); }

.header-menu-toggle.is-active .header-menu-icon{ background-color:transparent; }
.header-menu-toggle.is-active .header-menu-icon::before{ transform:rotate(45deg); }
.header-menu-toggle.is-active .header-menu-icon::after{ transform:rotate(-45deg); }

.page-title{
  color:#fff;
  margin:0;
  font-size:clamp(1.45rem, 1.1rem + 0.6vw, 1.9rem);
  font-weight:600;
  letter-spacing:0.01em;
  line-height:1.25;
  flex:1;
  text-align:left;
}

.global-search{
  position:relative;
  max-width:360px;
  width:100%;
}

.global-search__field{
  display:flex;
  align-items:center;
  gap:8px;
  background:rgba(255,255,255,0.12);
  border:1px solid rgba(255,255,255,0.25);
  border-radius:10px;
  padding:6px 10px;
  transition:border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

.global-search__field:focus-within{
  background:rgba(255,255,255,0.18);
  border-color:rgba(255,255,255,0.65);
  box-shadow:0 6px 24px rgba(0,0,0,0.25);
}

.global-search__icon{
  display:inline-flex;
  width:18px;
  height:18px;
  color:#fff;
}

.global-search__icon svg{
  width:18px;
  height:18px;
  fill:currentColor;
}

.global-search__input{
  flex:1;
  min-width:0;
  background:transparent;
  border:none;
  color:#fff;
  font-size:0.95rem;
  outline:none;
}

.global-search__input::placeholder{
  color:rgba(255,255,255,0.8);
}

.global-search__results{
  position:absolute;
  top:calc(100% + 6px);
  left:0;
  right:0;
  background:#fff;
  color:#0f172a;
  border-radius:12px;
  box-shadow:0 16px 40px rgba(12,25,100,0.25);
  margin:0;
  padding:6px 0;
  list-style:none;
  max-height:420px;
  overflow-y:auto;
  display:none;
  z-index:1100;
}

.global-search.has-results .global-search__results{
  display:block;
}

.global-search__result{
  padding:10px 14px;
  cursor:pointer;
  transition:background-color .15s ease;
}

.global-search__result:hover,
.global-search__result:focus-visible{
  background:#eef2ff;
  outline:none;
}

.global-search__result-title{
  font-weight:700;
  margin:0 0 4px 0;
  font-size:0.98rem;
  color:#0f172a;
  display:flex;
  align-items:center;
  gap:8px;
}

.global-search__badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:6px;
  background:#e0e7ff;
  color:#1e3a8a;
  border-radius:999px;
  padding:2px 10px;
  font-size:0.75rem;
  text-transform:capitalize;
}

.global-search__meta{
  display:block;
  margin:0 0 4px 0;
  color:#475569;
  font-size:0.9rem;
}

.global-search__description{
  margin:0;
  color:#64748b;
  font-size:0.9rem;
}

@media (max-width: 600px){
  .header{
    padding:0 16px;
  }

  .header-primary{
    gap:12px;
  }

  .header-logo{
    display:flex;
  }

  .page-title{
    font-size:1.125rem;
    line-height:1.3;
  }
}

.user-info{
  display:flex;
  align-items:center;
  margin-left:auto;
  margin-right:62px;
  padding-left:16px;
  color:#fff;
  border-left:1px solid rgba(255,255,255,0.3);
}

.user-info__toggle{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:44px;
  height:44px;
  padding:0;
  border:none;
  border-radius:50%;
  background:transparent;
  cursor:pointer;
  transition:transform .2s ease;
}

.user-info__toggle:focus-visible{
  outline:2px solid #fff;
  outline-offset:2px;
}

.user-info__avatar{
  display:flex;
  align-items:center;
  justify-content:center;
  width:100%;
  height:100%;
  border-radius:50%;
  background-color:rgba(255,255,255,0.22);
  color:#fff;
  font-size:2.4rem;
  transition:background-color .2s ease, transform .2s ease;
  overflow:hidden;
}

.user-avatar__image{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}

.user-info__toggle:hover .user-info__avatar,
.user-info__toggle:focus-visible .user-info__avatar{
  background-color:rgba(255,255,255,0.32);
  transform:translateY(-1px);
}

.sidebar-backdrop{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,0.45);
  z-index:1080;
  opacity:0;
  visibility:hidden;
  transition:opacity .32s ease;
}

.sidebar-backdrop.is-visible{
  opacity:1;
  visibility:visible;
}

body.sidebar-open{ overflow:hidden; }

.sr-only{
  position:absolute;
  width:1px;
  height:1px;
  padding:0;
  margin:-1px;
  overflow:hidden;
  clip:rect(0, 0, 0, 0);
  white-space:nowrap;
  border:0;
}

.user-menu{
  position:fixed;
  top:0;
  right:0;
  width:min(320px, 88vw);
  height:100%;
  display:flex;
  flex-direction:column;
  gap:24px;
  padding:24px 24px 32px;
  background:#fff;
  color:var(--text);
  box-shadow:-10px 0 24px rgba(0,0,0,0.2);
  transform:translateX(100%);
  transition:transform .32s ease;
  z-index:1200;
}

.user-menu.is-open{
  transform:translateX(0);
}

.user-menu__header{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:16px;
}

.user-menu__identity{
  display:flex;
  align-items:center;
  gap:12px;
}

.user-menu__avatar{
  display:flex;
  align-items:center;
  justify-content:center;
  width:48px;
  height:48px;
  border-radius:50%;
  background:linear-gradient(135deg, var(--brand, #1a349b) 70%, var(--accent, #ff0099) 100%);
  color:#fff;
  font-size:1.6rem;
  box-shadow:0 6px 18px rgba(26,52,155,0.25);
  overflow:hidden;
}

.user-menu__details{
  display:flex;
  flex-direction:column;
  gap:4px;
}

.user-menu__role{
  font-size:0.82rem;
  color:rgba(51,51,51,0.6);
}

.user-menu__greeting{
  font-size:0.72rem;
  letter-spacing:0.08em;
  text-transform:uppercase;
  color:rgba(51,51,51,0.55);
}

.user-menu__name{
  font-size:1.1rem;
  font-weight:700;
  color:var(--text);
  word-break:break-word;
}

.user-menu__close{
  background:none;
  border:none;
  font-size:1.5rem;
  line-height:1;
  cursor:pointer;
  color:#6b7280;
  transition:color .2s ease;
}

.user-menu__close:hover,
.user-menu__close:focus-visible{
  color:#dc2626;
  outline:none;
}

.user-menu__close:active{
  color:#b91c1c;
}

.user-menu__body{
  display:flex;
  flex-direction:column;
  gap:12px;
}

.user-menu__action{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:12px 16px;
  border-radius:12px;
  border:1px solid transparent;
  background:rgba(26,52,155,0.08);
  color:var(--text);
  font-size:0.95rem;
  font-weight:600;
  text-decoration:none;
  cursor:pointer;
  transition:background-color .2s ease, color .2s ease, border-color .2s ease, box-shadow .2s ease;
}

#user-profile-trigger.user-menu__action,
#user-affinity-trigger.user-menu__action{
  background:var(--brand, #1a349b);
  color:#fff;
  border-color:rgba(255,255,255,0.25);
  box-shadow:0 10px 20px -12px rgba(26,52,155,0.65);
}

#user-affinity-trigger.user-menu__action.user-menu__action--accent{
  background:rgba(189,33,60,0.15);
  color:#8b1026;
  border-color:rgba(189,33,60,0.35);
  box-shadow:0 10px 24px -14px rgba(189,33,60,0.65);
}

#user-affinity-trigger.user-menu__action.user-menu__action--pending{
  background:#fef4c5;
  color:#5a4400;
  border-color:#f2d675;
  box-shadow:0 10px 24px -14px rgba(215,178,58,0.45);
}

#user-profile-trigger.user-menu__action:hover,
#user-profile-trigger.user-menu__action:focus-visible{
    background:rgba(26,52,155,0.9);
    border-color:rgba(255,255,255,0.4);
  color:#fff;
}

#user-affinity-trigger.user-menu__action.user-menu__action--accent:hover,
#user-affinity-trigger.user-menu__action.user-menu__action--accent:focus-visible{
  background:rgba(189,33,60,0.25);
  border-color:rgba(189,33,60,0.55);
  color:#650819;
}

#user-affinity-trigger.user-menu__action.user-menu__action--pending:hover,
#user-affinity-trigger.user-menu__action.user-menu__action--pending:focus-visible{
  background:#fdeca3;
  border-color:#e0c65a;
  color:#4a3600;
}

.user-menu__action:hover,
.user-menu__action:focus-visible{
  background-color:rgba(26,52,155,0.14);
  border-color:rgba(26,52,155,0.24);
  box-shadow:0 6px 14px rgba(26,52,155,0.18);
  outline:none;
}

a.user-menu__action.user-menu__logout{
  background:linear-gradient(135deg, var(--brand, #1a349b) 70%, var(--accent, #ff0099) 100%);
  color:#fff;
  border-color:rgba(255,255,255,0.25);
  box-shadow:0 14px 28px -16px rgba(26,52,155,0.55);
  text-decoration:none;
}

a.user-menu__action.user-menu__logout:hover,
a.user-menu__action.user-menu__logout:focus-visible{
  background:linear-gradient(135deg, rgba(26,52,155,0.92) 65%, rgba(255,0,153,0.95) 110%);
  border-color:rgba(255,255,255,0.4);
  box-shadow:0 18px 34px -18px rgba(26,52,155,0.65);
  color:#fff;
}

.user-menu__action:not(a){
  border-color:transparent;
  border-width:1px;
  font:inherit;
}

.user-menu-backdrop{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,0.45);
  z-index:1100;
  opacity:0;
  transition:opacity .32s ease;
}

.user-menu-backdrop.is-visible{
  opacity:1;
}

/* ========= Tables ========= */
table{
  width:100%;
  border-collapse:collapse;
  margin:20px 0;
}
table, th, td{ border:1px solid var(--brand); }
th, td{
  padding:12px;
  text-align:center;
}
th{
  background-color: var(--brand);
  color:#fff;
}

/* ========= Layout helpers ========= */
.image-container{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:4%;
}
.image-container > div{ width:48%; }

.image-wrapper{
  flex:0 0 50%;
  text-align:center;
}

img{
  max-width:100%;
  height:auto;
}

/* ========= Alerts ========= */
.error{ color:red; }
.success{ color:green; }
.warning{ color:orange; }

/* ========= JSON Display ========= */
#jsonDisplay{
  background:#f4f4f9;
  color:#333;
  padding:20px;
  border-radius:5px;
  border:1px solid #ddd;
  max-height:500px;
  overflow-y:auto;
  font-family:'Courier New', Courier, monospace;
  white-space:pre-wrap;
  line-height:1.5;
}
.json-tree{ list-style:none; padding-left:20px; }
.json-key{ font-weight:bold; }

/* ========= Buttons ========= */
.styled-button{
  background-color: var(--brand);
  color:#fff;
  padding:10px 20px;
  font-size:16px;
  font-weight:bold;
  border:none;
  border-radius:5px;
  cursor:pointer;
  box-shadow:0 4px 6px rgba(0,0,0,.1);
  transition: background-color .3s ease, transform .2s ease;
  margin-top:20px;
}
.styled-button:hover{
  background-color:var(--brand-hover);
  transform: translateY(-2px);
}
.styled-button:active{
  background-color:var(--brand-active);
  transform: translateY(0);
}

.styled-button.cancel-button{
  background-color:#ff6666;
}

.styled-button.cancel-button:hover{
  background-color:#e05555;
}

.styled-button.cancel-button:active{
  background-color:#cc4c4c;
}

/* Unified modal header close button styling */
.modal-close{
  background:none;
  border:none;
  font-size:1.5rem;
  line-height:1;
  cursor:pointer;
  color:#6b7280;
  transition:color .2s ease;
}

.modal-close:hover,
.modal-close:focus-visible{
  color:#dc2626;
  outline:none;
}

.modal-close:active{
  color:#b91c1c;
}

.reset-password-btn{
  background-color: var(--brand);
  color:#fff;
  border:none;
  padding:5px 10px;
  border-radius:4px;
  cursor:pointer;
}
.reset-password-btn:hover{
  background-color:var(--brand-hover);
}

/* Ensure modal footer buttons sit side by side */
.modal-footer .styled-button{
  margin-top:0;
}

/* ========= Floating + Tooltip ========= */
.plus-button{
  position:fixed;
  bottom:20px;
  right:20px;
  width:80px;
  height:80px;
  border-radius:50%;
  background-color: var(--brand);
  color:#fff;
  font-size:36px;
  display:flex;
  justify-content:center;
  align-items:center;
  border:none;
  cursor:pointer;
  box-shadow:0 4px 6px rgba(0,0,0,.2);
  transition: background-color .3s, transform .2s;
  margin-bottom:50px;
}
.plus-button:hover{ background-color:var(--brand-hover); transform: translateY(-2px); }
.plus-button:active{ background-color:var(--brand-active); transform: translateY(0); }

.tooltip{
  display:none;
  position:fixed;
  bottom:150px;
  right:40px;
  background:#333;
  color:#fff;
  padding:5px 10px;
  border-radius:5px;
  font-size:14px;
  z-index:100;
}
.plus-button:hover + .tooltip{ display:block; }

/* ========= Footer & Content ========= */
/* Main layout */
.content{ flex:1; }
.page-body{
  padding:20px;
  margin-top:var(--header-height);
}

.page-footer{
  margin:0;
  background-color: var(--brand);
  color:#fff;
  text-align:center;
  padding:20px 16px;
  flex-shrink:0;
}

.page-footer__text{
  margin:0;
  font-size:0.95rem;
}

.has-sidebar .page-footer{
  margin-left:var(--sidebar-width);
  width:calc(100% - var(--sidebar-width));
}

@media (max-width: 900px){
  .has-sidebar .page-footer{
    margin-left:0;
    width:100%;
  }
}



/* Layout adjustment when sidebar is present */
.has-sidebar .content{
  margin-left:var(--sidebar-width);
}

.has-sidebar .header{
  left:var(--sidebar-width);
  width:calc(100% - var(--sidebar-width) - var(--header-right-offset));
}

.sidenav{ transition:transform .3s ease; }

/* ========= Side Navigation ========= */
.sidenav{
  width:var(--sidebar-width);
  background-color:#e0e0e0;
  overflow-y:auto;
  padding-top:20px;
  display:flex;
  flex-direction:column;
  border:1px solid #ccc;
  position:fixed;
  top:0;
  left:0;
  height:100vh;
  z-index:1100;
}

.sidenav-logo{
  width:150px;
  margin:-5px 20px 20px 3px;
  align-self:flex-start;
}

.sidenav__logo-link{
  display:flex;
  align-items:center;
  justify-content:flex-start;
  padding:0 20px 12px;
  margin-bottom:8px;
  border-radius:0;
}

.sidenav__logo-link:hover,
.sidenav__logo-link:focus-visible{
  background-color:transparent;
  box-shadow:none;
}

.sidenav a{
  padding:8px 20px;
  text-decoration:none;
  font-size:18px;
  color:var(--text);
  display:block;
  border-radius:12px;
  transition:color .2s ease, background-color .2s ease, box-shadow .2s ease;
}
.sidenav a:not(.sidenav__logo-link):hover,
.sidenav a:not(.sidenav__logo-link):focus-visible{
  color:var(--brand);
  background-color:rgba(26,52,155,0.08);
}
.sidenav a.active{
  background-color: var(--brand);
  color:#fff;
  box-shadow:0 8px 18px rgba(26,52,155,0.18);
}
.sidenav__link{
  display:flex;
  align-items:center;
  gap:14px;
  padding:0;
}
.sidenav__label{
  flex:1;
  min-width:0;
  line-height:1.35;
}
.sidenav__icon{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:2.25rem;
  height:2.25rem;
  color:var(--brand);
  background-color:rgba(26,52,155,0.1);
  border-radius:0.75rem;
  flex-shrink:0;
  transition:color .2s ease, background-color .2s ease, transform .2s ease;
}
.sidenav__icon svg{
  width:1.25rem;
  height:1.25rem;
  display:block;
  fill:currentColor;
}
.sidenav__link:hover .sidenav__icon,
.sidenav__link:focus-visible .sidenav__icon{
  background-color:rgba(26,52,155,0.16);
  transform:translateY(-1px);
}
.sidenav a.active .sidenav__icon{
  background-color:rgba(255,255,255,0.22);
  color:#fff;
}
.sidenav-divider{
  margin:10px 0;
  border:0;
  border-top:1px solid #ccc;
}
@media (max-height:450px){
  .sidenav{ padding-top:15px; }
  .sidenav a{ font-size:18px; }
}

@media (max-width: 900px){
  .has-sidebar .content{
    margin-left:0;
  }

  .has-sidebar .header{
    left:0;
    width:100%;
  }

  .has-sidebar .header{
    padding:0 16px;
  }

  .has-sidebar .header-primary{
    display:grid;
    grid-template-columns:auto 1fr;
    gap:12px;
    align-items:center;
  }

  .header-menu-toggle{
    display:inline-flex;
  }

  .has-sidebar .page-title{
    text-align:center;
    justify-self:center;
  }

  .user-info{
    margin-left:0;
    margin-right:26px;
    border-left:none;
    padding-left:0;
    justify-self:end;
  }

  .sidenav{
    left:0;
    right:auto;
    transform:translateX(-105%);
    width:min(260px, 78vw);
    max-width:78vw;
    box-shadow:6px 0 18px rgba(0,0,0,0.25);
  }

  .sidenav.is-open{
    transform:translateX(0);
  }

    .sidebar-backdrop.is-visible{
      opacity:1;
      visibility:visible;
    }
}

/* ========= Auth ========= */
.auth-container{
  display:flex;
  justify-content:center;
  align-items:center;
  min-height: calc(100vh - 200px);
  padding:40px 16px;
}
.auth-card{
  background:#fff;
  padding:40px;
  border-radius:8px;
  box-shadow:0 4px 8px rgba(0,0,0,.1);
  width:min(360px, 100%);
  text-align:center;
}
.auth-card form div{ margin-bottom:15px; text-align:left; }
.auth-card label{ display:block; margin-bottom:5px; }
.auth-card input{
  width:100%;
  padding:8px;
  border:1px solid #ccc;
  border-radius:4px;
}
.auth-card button{
  width:100%;
  padding:10px;
  background-color: var(--brand);
  color:#fff;
  border:none;
  border-radius:4px;
  cursor:pointer;
}
.auth-card button:hover{ background-color:var(--brand-hover); }
.auth-links{ margin-top:10px; }
.auth-links a{ color: var(--brand); text-decoration:none; margin:0 5px; }
.auth-links a:hover{ text-decoration:underline; }

.password-input-group{
  position:relative;
  display:flex;
  align-items:center;
}

.password-input-group input{
  padding-right:2.75rem;
}

.password-input-group .password-toggle-button{
  position:absolute;
  right:8px;
  background:none;
  border:none;
  padding:0;
  margin:0;
  width:auto;
  height:calc(100% - 4px);
  display:flex;
  align-items:center;
  justify-content:center;
  color:#666;
  cursor:pointer;
}

.password-input-group .password-toggle-button:hover,
.password-input-group .password-toggle-button:focus{
  background:none;
  color:var(--brand);
}

.password-input-group .password-toggle-button:focus-visible{
  outline:2px solid var(--brand);
  outline-offset:2px;
}

.password-toggle-icon{
  width:1.25rem;
  height:1.25rem;
  display:block;
}

.password-toggle-icon--hide{
  display:none;
}

.password-toggle-button[aria-pressed="true"] .password-toggle-icon--show{
  display:none;
}

@media (max-width: 600px){
  .auth-container{
    min-height:0;
    align-items:flex-start;
    padding:24px 16px 40px;
  }

  .auth-card{
    padding:28px 20px 32px;
    box-shadow:0 3px 10px rgba(0,0,0,0.12);
  }
}

.password-toggle-button[aria-pressed="true"] .password-toggle-icon--hide{
  display:block;
}

.password-actions{
  margin-top:8px;
}

.input-feedback{
  margin-top:6px;
  font-size:0.85rem;
}

.input-feedback--error{ color:#c0392b; }
.input-feedback--success{ color:#1b5e20; }
.input-feedback--info{ color:#444; }

.visually-hidden{
  position:absolute;
  width:1px;
  height:1px;
  padding:0;
  margin:-1px;
  overflow:hidden;
  clip:rect(0,0,0,0);
  white-space:nowrap;
  border:0;
}

/* ========= Upload (neue Variante) ========= */
#image-dropzone{
  border:2px dashed #ccc;
  padding:30px;
  text-align:center;
  background:#f9f9f9;
  color:#333;
  font-size:16px;
  transition: background-color .3s ease, border-color .3s ease;
  cursor:pointer;
  border-radius:10px;
  position:relative;
  margin-bottom:10px;
}
#image-dropzone.dragover{
  background-color:#e8f7ff;
  border-color:#008cba;
  color:#008cba;
}

/* Preview Grid */
#preview-container{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  justify-content:flex-start;
}

/* Kacheln */
.preview-item{
  position:relative;
  width:120px;
  height:120px;
  border:2px solid transparent;
  border-radius:6px;
  overflow:hidden;
  background:#fff;
  cursor:grab;
}
.preview-item:active{ cursor:grabbing; }

/* Bild in Kachel */
.preview-item img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
  -webkit-user-drag:none;
  user-select:none;
  pointer-events:none; /* Maus-Events bleiben auf der Kachel */
}

/* Primary-Status */
.preview-item.primary{ border-color: var(--brand); }

/* Buttons/Badges */
.remove-btn{
  position:absolute;
  top:5px; right:5px;
  background:rgba(0,0,0,.6);
  color:#fff;
  border:none;
  border-radius:50%;
  width:20px; height:20px;
  line-height:18px;
  text-align:center;
  cursor:pointer;
}
.primary-star{
  position:absolute;
  top:5px; left:5px;
  color:gold;
  font-size:20px;
  pointer-events:none;
}
.position-label{
  position:absolute;
  bottom:5px; left:5px;
  background:rgba(0,0,0,.6);
  color:#fff;
  padding:2px 4px;
  border-radius:3px;
  font-size:12px;
  pointer-events:none;
}

/* ========= Misc ========= */

.descriptionText{ display:none; }

/* Spinner */
#spinner{
  display:none;
  border:4px solid #f3f3f3;
  border-radius:50%;
  border-top:4px solid #3498db;
  width:40px; height:40px;
  animation:spin 2s linear infinite;
  margin:20px auto;
  text-align:center;
}
@keyframes spin{
  0%{ transform:rotate(0); }
  100%{ transform:rotate(360deg); }
}

/* Global Loader */
#loader-overlay{
  position:fixed;
  top:0;
  left:0;
  width:100%;
  height:100%;
  background:rgba(255,255,255,0.7);
  display:none;
  justify-content:center;
  align-items:center;
  /* keep loader behind modals so dialogs remain usable */
  z-index:900;
}
.has-sidebar #loader-overlay{
  left:var(--sidebar-width);
  width:calc(100% - var(--sidebar-width));
}
@media (max-width: 900px){
  .has-sidebar #loader-overlay{
    left:0;
    width:100%;
  }
}
#loader-overlay .loader{
  border:8px solid #f3f3f3;
  border-top:8px solid #3498db;
  border-radius:50%;
  width:60px;
  height:60px;
  animation:spin 2s linear infinite;
}

/* NewDG Layout */
.newDG_container{
  display:flex;
  justify-content:space-between;
  padding:20px;
}
.newDG_block{
  width:35%;
  background:#fff;
  border-radius:10px;
  padding:15px;
  box-shadow:0 0 10px rgba(0,0,0,.1);
  display:flex;
  flex-direction:column;
}
#newDG_dropArea{
  width:30%;
  height:400px;
  border:2px dashed var(--brand);
  border-radius:10px;
  display:flex;
  justify-content:center;
  align-items:center;
  background:#fff;
  position:relative;
  text-align:center;
  margin:0 20px;
  cursor:pointer;
}
.newDG_tooltip{
  display:none;
  position:absolute;
  top:10px; left:10px;
  background:#333;
  color:#fff;
  padding:5px 10px;
  border-radius:5px;
  z-index:100;
}
.newDG_dropdown{
  width:100%;
  padding:10px;
  margin:10px 0;
  border:1px solid #ccc;
  border-radius:5px;
}
/* Drop-Position Indikator */
.preview-item.drop-before {
  border-left: 3px solid #008cba; /* Linie links */
}
.preview-item.drop-after {
  border-right: 3px solid #008cba; /* Linie rechts */
}