:root {
  --sidebar-width: 300px;
  --color-bg: #121212;
  --color-card: #1e1e1e;
  --color-border: #2a2a2a;
  --color-text: #f0f0f0;
  --color-muted: #888;
  --color-primary: #dfb843; /* Vlip Gelb */
  --color-accent: #eac95a;  /* helleres Gelb als Hover */
  --radius: 10px;
  --transition: 0.25s ease;
}


* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  display: flex;
  min-height: 100vh;
}
body.noscroll { overflow: hidden; }

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background: #181818;
  display: flex;
  flex-direction: column;
  padding: 20px;
}
.sidebar .logo {
  width: 120px;
  margin: 0 auto 32px;
  display: block;
}
.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius);
  color: var(--color-text);
  text-decoration: none;
  margin-bottom: 8px;
  transition: background var(--transition);
}
.sidebar nav a.active,
.sidebar nav a:hover { background: var(--color-primary); }

.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.sidebar-close {
  background: none;
  border: none;
  color: var(--color-text);
  font-size: 28px;
  cursor: pointer;
  display: none;
}
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    top: 0; right: -240px;
    height: 100%;
    width: var(--sidebar-width);
    background: #181818;
    transition: right 0.3s ease;
    z-index: 1000;
    box-shadow: -8px 0 24px rgba(0,0,0,.35);
  }
  .sidebar.open { right: 0; }
  .sidebar-close { display: inline-flex; }
}

/* User-Panel (Desktop) */
.user-panel {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding: 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: #161616;
   text-decoration: none !important;
  color: inherit !important;
}
.user-panel .user-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--color-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
}
.user-panel .user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.user-panel .user-meta {
  color: var(--color-text);
  text-decoration: none;
  line-height: 1.4;
}
.user-panel .user-meta strong {
  font-weight: 600;
  display: block;
}
.user-panel .user-meta small {
  color: var(--color-muted);
  font-size: 12px;
}

/* Main + Topbar */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
.topbar {
  background: var(--color-card);
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--color-border);
}
.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.topbar h1 { font-size: 1.3em; font-weight: 600; }

.burger {
  background: none;
  border: none;
  cursor: pointer;
  display: none; /* nur mobil sichtbar */
  align-items: center;
  color: var(--color-text);
  font-size: 28px;
}
.burger > span { display: inline-block; }

/* Burger nur mobil */
@media (max-width: 768px) {
  .burger { display: flex; }
}

/* User-Avatar in Topbar (mobil) */
.topbar .user-avatar {
  display: none;
}
@media (max-width: 768px) {
  .topbar .user-avatar {
    display: flex;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--color-primary);
    color: #fff;
    align-items: center;
    justify-content: center;
    font-weight: 700;
  }
  .topbar .user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }
}

/* Language Switcher */
.lang-switcher a {
  margin-left: 8px;
  padding: 4px 8px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  text-decoration: none;
  color: var(--color-text);
  font-size: 13px;
  transition: background var(--transition);
}
.lang-switcher a.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
}
.topbar-lang { display: flex; align-items: center; gap: 8px; }
.topbar-lang a { margin: 0; }

/* Content */
.content { padding: 24px; }

/* Cards */
.card {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 4px 12px rgba(0,0,0,.3);
  animation: fadeIn .3s ease;
}
.card h2 { margin-bottom: 12px; font-size: 1.2em; }

/* Tables */
.table-box table { width: 100%; border-collapse: collapse; }
.table-box th, .table-box td { padding: 12px; border-bottom: 1px solid var(--color-border); }
.table-box th { background: #222; font-weight: 600; text-align: left; }
.table-box tr:hover td { background: #2a2a2a; }

/* Buttons */
button, .btn {
  background: var(--color-primary);
  border: none;
  padding: 10px 16px;
  border-radius: var(--radius);
  color: #fff;
  cursor: pointer;
  transition: background var(--transition);
  font-size: 14px;
  display: flex;;
  align-items: center;
  gap: 10px;
}
button:hover, .btn:hover { background: var(--color-accent); }
.btn-small,
a.btn-small {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  font-size: 13px;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  color: var(--color-text);
  text-decoration: none !important;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
}

.btn-small:hover,
a.btn-small:hover {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}

/* Alerts */
.error-box {
  background: #3a1a1a;
  border: 1px solid #a33;
  color: #f88;
  padding: 12px;
  border-radius: var(--radius);
  margin-bottom: 20px;
}
.success-box {
  background: #1a3a1a;
  border: 1px solid #3a3;
  color: #8f8;
  padding: 12px;
  border-radius: var(--radius);
  margin-bottom: 20px;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Dashboard */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}
.stat-card {
  text-align: center;
  transition: transform var(--transition), box-shadow var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px;
}
.stat-card .material-icons-outlined {
  font-size: 36px;
  color: var(--color-primary);
  margin-bottom: 8px;
}

/* Overlay */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease;
  z-index: 999;
}
.overlay.active { opacity: 1; pointer-events: auto; }

/* === Login-Seite === */
.login-body {
  display: flex;
  justify-content: center;
  align-items: center;
  background: var(--color-bg);
  height: 100vh;
  font-family: 'Outfit', sans-serif;
}
.login-wrapper { width: 100%; max-width: 380px; padding: 16px; }
.login-card { text-align: center; animation: fadeIn .4s ease; }
.login-card .logo { width: 120px; margin-bottom: 24px; }
.login-title { margin-bottom: 8px; font-size: 1.6em; font-weight: 600; }
.login-subtitle { margin-bottom: 24px; color: var(--color-muted); font-size: .95em; }
.login-form .form-group { position: relative; margin-bottom: 16px; }
.input-field {
  width: 100%;
  padding: 12px;
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  background: var(--color-card);
  color: var(--color-text);
  font-size: 15px;
  transition: border var(--transition);
}
.login-body .input-field { padding-left: 40px; }
.input-field:focus { border-color: var(--color-primary); outline: 0; }
.input-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-muted);
}
.login-btn { margin-top: 8px; width: 100%; padding: 12px; font-weight: 600; font-size: 15px; }
.lang-switcher { margin-bottom: 16px; }

/* === Profil === */
.form-group {
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
}
.form-group label {
  font-size: 14px;
  color: var(--color-muted);
}
.avatar-preview {
  margin-top: 12px;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--color-border);
}
.avatar-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
#cropper-container {
  margin-top: 12px;
  max-width: 360px;
  border: 1px dashed var(--color-border);
  border-radius: 8px;
  background: #101010;
}
#cropper-container img {
  max-width: 100%;
  display: block;
}

/* CropperJS Basis */
.cropper-container{direction:ltr;position:relative;touch-action:none;user-select:none}
.cropper-container img{display:block;max-width:100%}
.cropper-canvas,.cropper-crop-box,.cropper-drag-box,.cropper-modal,.cropper-wrap-box{
  position:absolute;top:0;left:0;right:0;bottom:0
}
.cropper-view-box{outline:1px solid #39f;outline-color:rgba(51,153,255,.75)}
.cropper-dashed{position:absolute;border:0 dashed #eee;opacity:.5}
.cropper-dashed.dashed-h{top:33.333%;bottom:33.333%;left:0;right:0;border-top-width:1px;border-bottom-width:1px}
.cropper-dashed.dashed-v{left:33.333%;right:33.333%;top:0;bottom:0;border-left-width:1px;border-right-width:1px}
.cropper-center{position:absolute;display:block;box-sizing:border-box;width:20px;height:20px;left:50%;top:50%;transform:translate(-50%,-50%)}
.cropper-center::before,.cropper-center::after{position:absolute;display:block;content:'';background-color:#eee}
.cropper-center::before{width:1px;height:20px;left:9px;top:0}
.cropper-center::after{width:20px;height:1px;left:0;top:9px}
.cropper-face,.cropper-line,.cropper-point{position:absolute;display:block;box-sizing:border-box}
.cropper-face{top:0;left:0;right:0;bottom:0;background-color:#fff;opacity:0}
.cropper-line{background-color:#39f}
.cropper-line.line-e{right:-3px;top:0;bottom:0;width:5px;cursor:ew-resize}
.cropper-line.line-n{left:0;right:0;top:-3px;height:5px;cursor:ns-resize}
.cropper-line.line-w{left:-3px;top:0;bottom:0;width:5px;cursor:ew-resize}
.cropper-line.line-s{left:0;right:0;bottom:-3px;height:5px;cursor:ns-resize}
.cropper-point{width:5px;height:5px;opacity:.75;background-color:#39f}
.cropper-point.point-e{cursor:ew-resize;right:-3px;top:50%;margin-top:-3px}
.cropper-point.point-n{cursor:ns-resize;left:50%;top:-3px;margin-left:-3px}
.cropper-point.point-w{cursor:ew-resize;left:-3px;top:50%;margin-top:-3px}
.cropper-point.point-s{cursor:ns-resize;left:50%;bottom:-3px;margin-left:-3px}
.cropper-point.point-ne{cursor:nesw-resize;right:-3px;top:-3px}
.cropper-point.point-nw{cursor:nwse-resize;left:-3px;top:-3px}
.cropper-point.point-sw{cursor:nesw-resize;left:-3px;bottom:-3px}
.cropper-point.point-se{cursor:nwse-resize;right:-3px;bottom:-3px;width:6px;height:6px}



/* === Tabs === */
.tabs {
  position: relative;
  display: flex;
  gap: 16px;
  border-bottom: 2px solid var(--color-border);
  margin-bottom: 20px;
}

.tab-link {
  position: relative;
  padding: 10px 0;
  color: var(--color-muted);
  font-weight: 500;
  text-decoration: none;
  transition: color var(--transition);
}

.tab-link.active,
.tab-link:hover {
  color: var(--color-primary);
}

.tab-link span {
  position: relative;
  z-index: 2;
}

.tab-indicator {
  position: absolute;
  bottom: -2px;
  height: 2px;
  background: var(--color-primary);
  border-radius: 2px;
  transition: all 0.3s ease;
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}
.modal.open { display: flex; }

.modal-content {
  background: var(--color-card);
  padding: 32px 28px;
  border-radius: var(--radius);
  width: 100%;
  max-width: 500px;
  position: relative;
  animation: fadeIn .3s ease;
  box-shadow: 0 8px 32px rgba(0,0,0,.45);
}

/* Modal Header */
.modal-content h3 {
  margin-bottom: 20px;
  font-size: 1.4em;
  font-weight: 600;
  color: var(--color-primary);
  border-bottom: 2px solid var(--color-border);
  padding-bottom: 10px;
}

/* Modal Close Button */
.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: none;
  border: none;
  color: var(--color-text);
  font-size: 28px;
  cursor: pointer;
  transition: color var(--transition);
}
.modal-close:hover {
  color: var(--color-primary);
}

/* Modal Form Inputs */
.modal-content .form-group {
  display: flex;
  flex-direction: column;
}

.modal-content .form-group label {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-muted);
  margin-left: 6px;
}

.modal-content .input-field {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  background: var(--color-bg);
  color: var(--color-text);
  font-size: 15px;
  transition: border var(--transition), background var(--transition);
}
.modal-content .input-field:focus {
  border-color: var(--color-primary);
  outline: 0;
  background: #1a1a1a;
}

/* Modal Buttons */
.modal-content .btn {
  margin-top: 12px;
  background: var(--color-primary);
  color: #000;
  font-weight: 600;
}
.modal-content .btn:hover {
  background: var(--color-accent);
}

