:root{
  --dark:#31393C;
  --yellow:#FFCB00;
  --bg:#f6f7fb;
  --card:#fff;
  --text:#111827;
  --muted:#6b7280;
  --line:#e6e8ee;
  --r:16px;
  --shadow:0 10px 28px rgba(17,24,39,.08);
}

*{box-sizing:border-box;}
html,body{height:100%;}
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial;
  background:var(--bg);
  color:var(--text);
  overflow-x:hidden; /* wichtig */
}

.topbar{
  position:sticky; top:0; z-index:999;
  background:rgba(49,57,60,.94);
  backdrop-filter: blur(10px);
  border-bottom:1px solid rgba(255,255,255,.10);
  box-shadow:0 10px 25px rgba(0,0,0,.18);
}
.topbar-inner{
  max-width:1280px;
  margin:0 auto;
  padding:10px 16px;
  display:flex;
  align-items:center;
  gap:12px;
}
.brand{
  display:flex; align-items:center; gap:10px;
  text-decoration:none;
  color:#fff;
  font-weight:900;
}
.brand img{ height:30px; width:auto; display:block; }
.brand span{ letter-spacing:.02em; }

.nav{
  display:flex;
  align-items:center;
  gap:6px;
  flex:1;
  flex-wrap:wrap;
}
.nav a{
  display:inline-flex; align-items:center; gap:8px;
  padding:9px 12px;
  border-radius:14px;
  text-decoration:none;
  color:rgba(255,255,255,.92);
  font-weight:800;
}
.nav a i{ color:var(--yellow); }
.nav a:hover{ background:rgba(255,255,255,.10); }
.nav a.active{
  background:rgba(255,203,0,.18);
  box-shadow: inset 0 0 0 1px rgba(255,203,0,.35);
}

.logout{
  display:inline-flex; align-items:center; gap:8px;
  padding:9px 12px;
  border-radius:14px;
  text-decoration:none;
  color:#fff;
  font-weight:900;
  background:rgba(255,255,255,.10);
  border:1px solid rgba(255,255,255,.12);
}
.logout i{ color:var(--yellow); }
.logout:hover{ background:rgba(255,255,255,.14); }

.dropdown{ position:relative; }
.dropbtn{
  display:inline-flex; align-items:center; gap:8px;
  padding:9px 12px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.12);
  background:rgba(255,255,255,.08);
  color:#fff;
  font-weight:900;
  cursor:pointer;
}
.dropbtn i{ color:var(--yellow); }
.dropdown-menu{
  display:none;
  position:absolute;
  right:0;
  top:44px;
  min-width:220px;
  background:#1f2427;
  border:1px solid rgba(255,255,255,.10);
  border-radius:14px;
  box-shadow:0 18px 50px rgba(0,0,0,.25);
  padding:8px;
}
.dropdown-menu a{
  display:flex; align-items:center; gap:10px;
  padding:10px 10px;
  border-radius:12px;
  color:rgba(255,255,255,.92);
}
.dropdown-menu a:hover{ background:rgba(255,255,255,.10); }
.dropdown:hover .dropdown-menu{ display:block; }

.wrapper{
  max-width:1280px;
  margin:0 auto;
  padding:26px 16px 40px;
}

.card{
  background:var(--card);
  border:1px solid var(--line);
  border-radius:var(--r);
  box-shadow:var(--shadow);
  padding:18px;
  margin-bottom:14px;
}

h1{margin:0 0 8px 0; color:var(--dark); letter-spacing:-.02em;}
.muted{color:var(--muted);}

/* responsive: nav wird automatisch mehrzeilig */
@media (max-width: 880px){
  .topbar-inner{ flex-wrap:wrap; }
  .logout{ margin-left:auto; }
  .dropdown-menu{ left:0; right:auto; }
}

/* ===== TOP NAV (ersetzt Sidebar / Dropdown "Mehr") ===== */
body{
  display: block; /* überschreibt evtl. altes display:flex von Sidebar */
}

.top-nav{
  position: sticky;
  top: 0;
  z-index: 9999;
  background: #f0f0f0;
  border-bottom: 1px solid #e0e0e0;
}

.top-nav__inner{
  max-width: 1400px;
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.top-nav__brand{
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 10px;
}

.top-nav__brand img{
  height: 34px;
  width: auto;
  display: block;
}

.top-nav__links{
  display: flex;
  flex: 1;
  flex-wrap: wrap;          /* <- alle Links sichtbar, bricht in nächste Zeile */
  gap: 8px;
  align-items: center;
}

.top-nav__links a,
.top-nav__logout{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: #31393C;
  font-weight: 700;
  padding: 8px 10px;
  border-radius: 10px;
  background: transparent;
  border: 1px solid transparent;
}

.top-nav__links a:hover,
.top-nav__logout:hover{
  background: #e0e0e0;
  border-color: #d9d9d9;
}

.top-nav__links i,
.top-nav__logout i{
  color: #31393C;
}

.top-nav__right{
  display: flex;
  align-items: center;
  gap: 10px;
}

.top-nav__logout{
  background: #31393C;
  color: #FFCB00;
  border-color: #31393C;
}

.top-nav__logout i{
  color: #FFCB00;
}

/* Wrapper muss NICHT mehr links Platz lassen */
.dashboard-wrapper,
.wrapper{
  margin-left: 0 !important;
  padding: 18px !important;
}

/* Mobile: Text ausblenden, nur Icons zeigen (optional, aber sehr nice) */
@media (max-width: 900px){
  .top-nav__links a span,
  .top-nav__logout span{
    display: none;
  }
}