/* CCH Drawer Navigation - Logo Fix Version */
.cch-app-topbar{
  position:sticky;
  top:0;
  z-index:90;
  backdrop-filter:blur(18px);
  background:rgba(245,247,251,.76);
  border-bottom:1px solid rgba(219,227,239,.86);
}
.cch-app-topbar-inner{
  width:min(calc(100% - 40px),1760px);
  margin:0 auto;
  min-height:58px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}
.cch-app-title{
  display:flex;
  align-items:center;
  gap:10px;
  min-width:0;
}
.cch-app-mark{
  width:40px !important;
  height:40px !important;
  min-width:40px !important;
  min-height:40px !important;
  max-width:40px !important;
  max-height:40px !important;
  border-radius:12px;
  overflow:hidden;
  background:none !important;
  box-shadow:none !important;
  display:flex;
  align-items:center;
  justify-content:center;
  flex:0 0 40px !important;
}
.cch-app-mark img{
  width:100%;
  height:100%;
  object-fit:contain;
  display:block;
}
.cch-app-title-text{
  display:flex;
  flex-direction:column;
  min-width:0;
}
.cch-app-title-text strong{
  font-size:14px;
  line-height:1.1;
  color:#0f172a;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.cch-app-title-text span{
  font-size:11px;
  color:#64748b;
  margin-top:2px;
}
.cch-menu-button{
  width:42px !important;
  height:42px;
  border-radius:15px;
  border:1px solid rgba(219,227,239,.9);
  background:linear-gradient(180deg,rgba(255,255,255,.94),rgba(241,245,251,.88));
  color:#0f172a;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  box-shadow:0 8px 22px rgba(15,23,42,.08);
  font-weight:900;
  font-size:22px;
  padding:0 !important;
}
.cch-menu-button:hover{
  transform:translateY(-1px);
  box-shadow:0 12px 30px rgba(15,23,42,.12);
}
.cch-drawer-backdrop{
  position:fixed;
  inset:0;
  background:rgba(15,23,42,.36);
  backdrop-filter:blur(6px);
  opacity:0;
  pointer-events:none;
  transition:opacity .18s ease;
  z-index:200;
}
.cch-drawer-backdrop.show{
  opacity:1;
  pointer-events:auto;
}
.cch-drawer{
  position:fixed;
  top:0;
  right:0;
  height:100vh;
  width:min(420px,calc(100vw - 24px));
  z-index:210;
  transform:translateX(105%);
  transition:transform .22s cubic-bezier(.2,.8,.2,1);
  background:linear-gradient(180deg,rgba(255,255,255,.94),rgba(247,250,255,.90));
  backdrop-filter:blur(22px);
  border-left:1px solid rgba(219,227,239,.9);
  box-shadow:-24px 0 70px rgba(15,23,42,.18);
  display:flex;
  flex-direction:column;
}
.cch-drawer.show{
  transform:translateX(0);
}
.cch-drawer-head{
  padding:18px;
  border-bottom:1px solid rgba(219,227,239,.9);
  display:flex;
  justify-content:space-between;
  gap:12px;
  align-items:flex-start;
}
.cch-drawer-brand{
  display:flex;
  gap:12px;
  align-items:center;
  min-width:0;
}
.cch-drawer-logo{
  width:44px;
  height:44px;
  border-radius:14px;
  overflow:hidden;
  display:flex;
  align-items:center;
  justify-content:center;
  background:none;
  box-shadow:none;
  flex:0 0 auto;
}
.cch-drawer-logo img{
  width:100%;
  height:100%;
  object-fit:contain;
  display:block;
}
.cch-drawer-brand strong{
  display:block;
  font-size:17px;
  letter-spacing:-.02em;
  color:#0f172a;
}
.cch-drawer-brand span{
  display:block;
  margin-top:3px;
  color:#64748b;
  font-size:12px;
}
.cch-drawer-close{
  width:38px !important;
  height:38px;
  padding:0 !important;
  border-radius:14px;
  border:1px solid rgba(219,227,239,.9);
  background:rgba(255,255,255,.74);
  color:#0f172a;
  cursor:pointer;
  font-weight:900;
}
.cch-drawer-user{
  margin:14px 18px 0;
  padding:13px;
  border:1px solid rgba(219,227,239,.9);
  border-radius:18px;
  background:rgba(255,255,255,.68);
}
.cch-drawer-user .label{
  font-size:11px;
  text-transform:uppercase;
  letter-spacing:.08em;
  color:#64748b;
  font-weight:800;
}
.cch-drawer-user .name{
  margin-top:5px;
  font-size:15px;
  font-weight:850;
  color:#0f172a;
}
.cch-drawer-user .role{
  margin-top:3px;
  font-size:12px;
  color:#64748b;
}
.cch-drawer-nav{
  padding:14px 18px;
  overflow:auto;
  flex:1;
}
.cch-drawer-section-title{
  margin:14px 0 8px;
  font-size:11px;
  color:#64748b;
  text-transform:uppercase;
  letter-spacing:.08em;
  font-weight:850;
}
.cch-drawer-link{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:12px 13px;
  border:1px solid transparent;
  border-radius:16px;
  color:#0f172a;
  text-decoration:none;
  font-weight:750;
  margin-bottom:6px;
  transition:.16s ease;
}
.cch-drawer-link small{
  display:block;
  margin-top:2px;
  color:#64748b;
  font-size:11px;
  font-weight:600;
}
.cch-drawer-link:hover{
  background:rgba(255,255,255,.78);
  border-color:rgba(219,227,239,.9);
  transform:translateY(-1px);
}
.cch-drawer-link.active{
  background:rgba(11,99,196,.09);
  border-color:rgba(11,99,196,.22);
  color:#083b8b;
}
.cch-drawer-link-arrow{
  color:#64748b;
  font-weight:900;
}
.cch-drawer-foot{
  padding:16px 18px 18px;
  border-top:1px solid rgba(219,227,239,.9);
  display:grid;
  gap:10px;
}
.cch-logout-button{
  width:100% !important;
  border-radius:16px;
  border:1px solid #fecaca;
  background:linear-gradient(180deg,#fff5f5,#fee2e2);
  color:#b42318;
  padding:12px 14px;
  font-weight:850;
  cursor:pointer;
}
.cch-logout-button:hover{
  background:linear-gradient(180deg,#fff1f1,#fecaca);
}
.cch-drawer-foot-note{
  font-size:11px;
  color:#64748b;
  text-align:center;
}
body.cch-drawer-open{
  overflow:hidden;
}
@media(max-width:700px){
  .cch-app-topbar-inner{
    width:min(calc(100% - 20px),100%);
  }
  .cch-app-title-text span{
    display:none;
  }
}


/* =========================================================
   CCH Desktop Right Rail Navigation
   Desktop: feste rechte Menüleiste, kein Drei-Punkte-Menü.
   Mobile/Tablet: vorhandener Drawer bleibt aktiv.
   ========================================================= */
.cch-desktop-rail{
  display:none;
}

.cch-rail-head,
.cch-rail-foot{
  flex:0 0 auto;
}

.cch-rail-head{
  padding:16px 16px 12px;
  border-bottom:1px solid rgba(219,227,239,.9);
  display:flex;
  align-items:center;
  gap:12px;
}

.cch-rail-logo{
  width:42px;
  height:42px;
  border-radius:14px;
  display:flex;
  align-items:center;
  justify-content:center;
  overflow:hidden;
  flex:0 0 auto;
}

.cch-rail-logo img{
  width:100%;
  height:100%;
  object-fit:contain;
  display:block;
}

.cch-rail-head strong{
  display:block;
  color:#0f172a;
  font-size:16px;
  letter-spacing:-.02em;
}

.cch-rail-head span{
  display:block;
  margin-top:3px;
  color:#64748b;
  font-size:12px;
}

.cch-rail-nav{
  flex:1;
  overflow:auto;
  padding:12px 12px 14px;
}

.cch-rail-section-title{
  margin:14px 8px 8px;
  font-size:10px;
  color:#64748b;
  text-transform:uppercase;
  letter-spacing:.08em;
  font-weight:850;
}

.cch-rail-link{
  display:flex;
  align-items:center;
  text-decoration:none;
  color:#0f172a;
  padding:10px 11px;
  border-radius:14px;
  border:1px solid transparent;
  margin-bottom:5px;
  transition:background .16s ease, border-color .16s ease, transform .16s ease, color .16s ease;
  font-weight:780;
}

.cch-rail-link small{
  display:block;
  margin-top:2px;
  color:#64748b;
  font-size:10.5px;
  font-weight:600;
}

.cch-rail-link:hover{
  background:rgba(255,255,255,.82);
  border-color:rgba(219,227,239,.95);
  transform:translateX(-1px);
}

.cch-rail-link.active{
  background:rgba(11,99,196,.10);
  border-color:rgba(11,99,196,.24);
  color:#083b8b;
}

.cch-rail-foot{
  padding:12px 14px 14px;
  border-top:1px solid rgba(219,227,239,.9);
  display:grid;
  gap:9px;
}

@media (min-width:900px){
  body{
    padding-right:292px;
  }

  .cch-app-topbar{
    right:292px;
  }

  .cch-app-topbar-inner{
    width:min(calc(100% - 40px),1760px);
  }

  .cch-menu-button,
  .cch-drawer,
  .cch-drawer-backdrop{
    display:none !important;
  }

  .cch-desktop-rail{
    position:fixed;
    top:0;
    right:0;
    height:100vh;
    width:292px;
    z-index:220;
    display:flex;
    flex-direction:column;
    background:linear-gradient(180deg,rgba(255,255,255,.92),rgba(247,250,255,.88));
    border-left:1px solid rgba(219,227,239,.9);
    box-shadow:-18px 0 54px rgba(15,23,42,.10);
    backdrop-filter:blur(22px);
    -webkit-backdrop-filter:blur(22px);
  }

  .cch-desktop-rail .cch-drawer-user{
    margin:12px 14px 0;
  }
}

@media (max-width:899px){
  .cch-desktop-rail{
    display:none !important;
  }
}


/* =========================================================
   CCH NAV FAILSAFE REPAIR 1.2.1
   Ziel: Navigation darf nie vollständig verschwinden.
   Desktop >=900px: rechte Rail sichtbar, Drei-Punkte aus.
   Mobile <900px: Topbar + Drei-Punkte-Drawer sichtbar.
   ========================================================= */
.cch-app-topbar{
  display:block !important;
  visibility:visible !important;
  opacity:1 !important;
}
.cch-app-topbar-inner{
  display:flex !important;
}
.cch-menu-button{
  display:inline-flex !important;
}
.cch-drawer{
  display:flex;
}
.cch-drawer-backdrop{
  display:block;
}
.cch-desktop-rail{
  display:none;
}

@media (min-width:900px){
  body{
    padding-right:292px !important;
  }
  .cch-app-topbar{
    right:292px !important;
  }
  .cch-menu-button,
  .cch-drawer,
  .cch-drawer-backdrop{
    display:none !important;
  }
  .cch-desktop-rail{
    position:fixed !important;
    top:0 !important;
    right:0 !important;
    height:100vh !important;
    width:292px !important;
    z-index:220 !important;
    display:flex !important;
    flex-direction:column !important;
    visibility:visible !important;
    opacity:1 !important;
    background:linear-gradient(180deg,rgba(255,255,255,.92),rgba(247,250,255,.88));
    border-left:1px solid rgba(219,227,239,.9);
    box-shadow:-18px 0 54px rgba(15,23,42,.10);
    backdrop-filter:blur(22px);
    -webkit-backdrop-filter:blur(22px);
  }
}

@media (max-width:899px){
  body{
    padding-right:0 !important;
  }
  .cch-app-topbar{
    right:0 !important;
  }
  .cch-desktop-rail{
    display:none !important;
  }
  .cch-menu-button{
    display:inline-flex !important;
  }
}
