﻿.topbar{
  position:fixed;
  top:0;
  left:0;
  right:0;
  height:var(--topbar-h);
  z-index:1030;
  background:rgba(15,15,15,.78);
  color:#f5f5f5;
  border-bottom:1px solid rgba(255,255,255,.10);
  backdrop-filter:blur(18px);
  box-shadow:0 8px 28px rgba(0,0,0,.14);
  color-scheme:dark;
}

.topbar__inner{
  width:min(1440px, calc(100vw - 48px));
  margin:0 auto;
  min-height:var(--topbar-h);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:1rem;
}

.topbar__brand{
  display:flex;
  align-items:center;
  gap:.9rem;
  color:#fff;
  min-width:0;
}

.topbar__logo{
  height:42px;
  width:auto;
  max-height:none;
  flex:0 0 auto;
}

.topbar__brand-app{
  display:flex;
  align-items:center;
  gap:.6rem;
}

.topbar__brand-divider{
  width:1px;
  height:40px;
  background:rgba(255,255,255,.18);
}

.topbar__brand-system{
  font:700 .88rem/.98 var(--font-title);
  letter-spacing:-.03em;
  display:inline-block;
  text-transform:none;
  color:#fff;
}

.topbar__actions{
  display:flex;
  align-items:center;
  gap:.65rem;
  margin-left:auto;
}

.topbar-menu{
  position:relative;
  margin:0;
}

.topbar-menu[open]{
  z-index:1050;
}

.topbar-menu__toggle{
  list-style:none;
  display:inline-flex;
  align-items:center;
  gap:.65rem;
  padding:.78rem 1rem;
  border-radius:16px;
  border:1px solid rgba(255,255,255,.12);
  background:rgba(255,255,255,.08);
  color:rgba(255,255,255,.9);
  font-size:.92rem;
  font-weight:700;
  cursor:pointer;
  user-select:none;
  box-shadow:0 10px 24px rgba(0,0,0,.12);
  transition:background-color .2s ease, transform .2s ease;
}

.topbar-menu__toggle::-webkit-details-marker{
  display:none;
}

.topbar-menu__toggle:hover{
  background:rgba(255,255,255,.12);
  transform:translateY(-1px);
}

.topbar-menu__caret{
  font-size:.85rem;
  transition:transform .2s ease;
}

.topbar-menu[open] .topbar-menu__caret{
  transform:rotate(180deg);
}

.topbar-menu__panel{
  position:absolute;
  top:calc(100% + .7rem);
  right:0;
  min-width:250px;
  padding:.55rem;
  background:rgba(20,21,24,.94);
  border:1px solid rgba(255,255,255,.08);
  border-radius:18px;
  box-shadow:0 22px 44px rgba(0,0,0,.24);
  backdrop-filter:blur(18px);
}

.topbar-menu__panel a{
  display:flex;
  align-items:center;
  padding:.72rem .85rem;
  border-radius:12px;
  color:rgba(255,255,255,.88);
  font-family:var(--font-body);
  font-size:var(--font-size-p);
  font-weight:500;
}

.topbar-menu__panel a:hover{
  background:rgba(255,255,255,.08);
  color:#fff;
}

.topbar-menu__panel--user{
  min-width:270px;
}

.topbar-user-card{
  display:flex;
  flex-direction:column;
  gap:.18rem;
  padding:.8rem .85rem;
  margin-bottom:.35rem;
  border-radius:14px;
  background:rgba(255,255,255,.06);
  color:#fff;
}

.topbar-user-card__label{
  font-size:.72rem;
  text-transform:uppercase;
  letter-spacing:.08em;
  color:rgba(255,255,255,.56);
}

.topbar-user-card strong{
  font-size:.94rem;
  line-height:1.3;
}

.topbar-user-card__role{
  color:rgba(255,255,255,.68);
  font-size:.8rem;
  line-height:1.25;
}

.topbar-menu__panel a.is-danger{
  color:#ff9f96;
}

.topbar-menu__panel a.is-danger:hover{
  background:rgba(255,104,91,.12);
  color:#ffc0ba;
}

@media(max-width:767.98px){
  .topbar{
    height:auto;
  }

  .topbar__inner{
    width:min(100vw - 24px, 100vw - 24px);
    min-height:var(--topbar-h);
    flex-wrap:wrap;
    padding-top:.65rem;
    padding-bottom:.65rem;
    gap:.75rem;
  }

  .topbar__brand{
    width:100%;
  }

  .topbar__brand-divider{
    display:none;
  }

  .topbar__brand-system{
    font-size:.88rem;
    line-height:1;
  }

  .topbar__actions{
    width:100%;
    justify-content:space-between;
    margin-left:0;
  }

  .topbar-menu{
    flex:1 1 0;
  }

  .topbar-menu__toggle{
    width:100%;
    justify-content:center;
    padding:.72rem .9rem;
  }

  .topbar-menu__panel{
    left:0;
    right:auto;
    min-width:230px;
  }
}




