/* WarEra Web Intel global collapsible sidebar v69 */
:root {
  --sidebar-collapsed: 68px;
  --sidebar-expanded: 250px;
  --sidebar-width: var(--sidebar-collapsed);
  --sidebar-bg: #060b12;
  --sidebar-hover: #122039;
  --sidebar-active: #18345c;
  --sidebar-active-line: #67a6ff;
  --sidebar-transition: 180ms cubic-bezier(.2,.75,.25,1);
}

html.sidebar-expanded { --sidebar-width: var(--sidebar-expanded); }

.layout {
  display: flex;
  min-height: 100vh;
}

.side {
  position: fixed;
  z-index: 1000;
  inset: 0 auto 0 0;
  display: flex;
  flex-direction: column;
  width: var(--sidebar-width);
  height: 100dvh;
  padding: 10px 8px;
  overflow: visible;
  border-right: 1px solid var(--line);
  background: var(--sidebar-bg);
  transition: width var(--sidebar-transition), transform var(--sidebar-transition);
}

.main {
  min-width: 0;
  width: calc(100% - var(--sidebar-width));
  margin-left: var(--sidebar-width);
  transition: width var(--sidebar-transition), margin-left var(--sidebar-transition);
}

.sidebar-head {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 48px;
  margin-bottom: 8px;
}

.sidebar-brand {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
  width: 100%;
  height: 48px;
  gap: 10px;
  padding: 0 7px;
  border-radius: 12px;
}

.sidebar-brand:hover { background: rgba(255,255,255,.035); }

.sidebar-brand-mark,
.mobile-brand-mark {
  display: grid;
  place-items: center;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(103,166,255,.42);
  border-radius: 11px;
  background: linear-gradient(145deg,#173c69,#0e2038);
  color: #eef6ff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12),0 7px 18px rgba(0,0,0,.22);
  font-size: 20px;
  font-weight: 900;
}

.sidebar-brand-copy,
.mobile-brand-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.05;
}

.sidebar-brand-copy strong { font-size: 18px; }
.sidebar-brand-copy small { margin-top: 4px; color: var(--blue); font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }

.sidebar-brand-copy,
.userbox-copy,
.nav-label,
.nav-section-label {
  opacity: 0;
  visibility: hidden;
  transform: translateX(-4px);
  white-space: nowrap;
  transition: opacity 100ms ease, visibility 100ms ease, transform 100ms ease;
}

html.sidebar-expanded .sidebar-brand-copy,
html.sidebar-expanded .userbox-copy,
html.sidebar-expanded .nav-label,
html.sidebar-expanded .nav-section-label {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
  transition-delay: 60ms;
}

.sidebar-toggle {
  position: absolute;
  z-index: 4;
  top: 50%;
  right: -21px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  min-height: 0;
  padding: 0;
  transform: translateY(-50%);
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #102039;
  color: #eaf3ff;
  box-shadow: 0 7px 18px rgba(0,0,0,.28);
}

.sidebar-toggle:hover { background: #18345c; }
.sidebar-toggle svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; transition: transform var(--sidebar-transition); }
html.sidebar-expanded .sidebar-toggle svg { transform: rotate(180deg); }

.mobile-close-button { display: none; }

.userbox {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 48px;
  gap: 10px;
  margin: 4px 0 10px;
  padding: 5px 7px;
  overflow: visible;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--muted);
}

.userbox-avatar {
  display: grid;
  place-items: center;
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: #152b49;
  color: #fff;
  font-size: 14px;
  font-weight: 900;
}

.userbox-copy { min-width: 0; overflow: hidden; }
.userbox-copy b { display: block; overflow: hidden; color: var(--text); font-size: 13px; text-overflow: ellipsis; }
.userbox-copy small { display: block; margin-top: 2px; font-size: 11px; text-transform: capitalize; }

.nav {
  flex: 1;
  min-height: 0;
  margin: 0 -3px;
  padding: 0 3px 8px;
  overflow-x: visible;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #243b5b transparent;
}

.nav::-webkit-scrollbar { width: 5px; }
.nav::-webkit-scrollbar-thumb { border-radius: 10px; background: #243b5b; }

.nav-group { position: relative; }
.nav-section-label {
  height: 24px;
  padding: 8px 11px 4px;
  overflow: hidden;
  color: #6f86a6;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.nav-divider {
  height: 1px;
  margin: 8px 9px;
  background: var(--line);
  opacity: .75;
}

.nav a.nav-link,
.nav-link {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  height: 44px;
  gap: 11px;
  margin: 2px 0;
  padding: 0 10px;
  overflow: visible;
  border: 1px solid transparent;
  border-radius: 11px;
  color: #aebfd8;
  text-decoration: none;
  transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
}

.nav a.nav-link:hover,
.nav-link:hover {
  background: var(--sidebar-hover);
  color: #fff;
}

.nav-link.active {
  border-color: rgba(103,166,255,.18);
  background: var(--sidebar-active);
  color: #fff;
  box-shadow: inset 3px 0 0 var(--sidebar-active-line);
}

.nav-icon {
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-label {
  min-width: 0;
  overflow: hidden;
  font-size: 13px;
  font-weight: 750;
  text-overflow: ellipsis;
}

.sidebar-footer {
  flex: 0 0 auto;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.logout-link:hover { background: rgba(255,98,112,.12); color: #ff9aa4; }

/* Collapse geometry: remove hidden text from the flex layout so icons stay centered. */
@media (min-width: 981px) {
  html:not(.sidebar-expanded) .sidebar-brand-copy,
  html:not(.sidebar-expanded) .userbox-copy,
  html:not(.sidebar-expanded) .nav-label,
  html:not(.sidebar-expanded) .nav-section-label {
    display: none;
  }

  html:not(.sidebar-expanded) .sidebar-brand,
  html:not(.sidebar-expanded) .userbox,
  html:not(.sidebar-expanded) .nav a.nav-link,
  html:not(.sidebar-expanded) .nav-link {
    justify-content: center;
    gap: 0;
  }

  html:not(.sidebar-expanded) .sidebar-brand { padding: 0; }
  html:not(.sidebar-expanded) .userbox { padding: 5px; }
  html:not(.sidebar-expanded) .nav a.nav-link,
  html:not(.sidebar-expanded) .nav-link { padding: 0; }
}

/* CSS tooltip is only active while collapsed on desktop. */
@media (min-width: 981px) {
  html:not(.sidebar-expanded) [data-tooltip]::after {
    position: absolute;
    z-index: 1200;
    top: 50%;
    left: calc(100% + 12px);
    max-width: 240px;
    padding: 8px 10px;
    transform: translate(5px,-50%);
    border: 1px solid #304565;
    border-radius: 8px;
    background: #0d1829;
    color: #f2f7ff;
    box-shadow: 0 10px 28px rgba(0,0,0,.4);
    content: attr(data-tooltip);
    font-size: 12px;
    font-weight: 750;
    line-height: 1.25;
    opacity: 0;
    pointer-events: none;
    white-space: nowrap;
    transition: opacity 100ms ease, transform 100ms ease;
  }

  html:not(.sidebar-expanded) [data-tooltip]:hover::after,
  html:not(.sidebar-expanded) [data-tooltip]:focus-visible::after {
    transform: translate(0,-50%);
    opacity: 1;
  }
}

.mobile-topbar,
.mobile-nav-overlay { display: none; }

@media (max-width: 980px) {
  :root,
  html.sidebar-expanded { --sidebar-width: 0px; }

  .layout { display: block; }

  .side {
    z-index: 1002;
    width: min(86vw,320px) !important;
    height: 100dvh !important;
    padding: 10px 10px 14px !important;
    overflow: visible;
    transform: translateX(-105%);
    box-shadow: 18px 0 50px rgba(0,0,0,.45);
  }

  body.mobile-nav-open .side { transform: translateX(0); }

  .main {
    width: 100% !important;
    margin-left: 0 !important;
  }

  .sidebar-brand-copy,
  .userbox-copy,
  .nav-label,
  .nav-section-label,
  html.sidebar-expanded .sidebar-brand-copy,
  html.sidebar-expanded .userbox-copy,
  html.sidebar-expanded .nav-label,
  html.sidebar-expanded .nav-section-label {
    opacity: 1;
    visibility: visible;
    transform: none;
  }

  .sidebar-toggle { display: none; }

  .mobile-close-button {
    position: absolute;
    z-index: 5;
    top: 5px;
    right: 2px;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    min-height: 0;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #102039;
    color: #fff;
  }

  .mobile-close-button svg,
  .mobile-menu-button svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
  }

  .sidebar-brand { padding-right: 48px; }
  .nav a.nav-link,.nav-link { padding: 0 11px; }

  .mobile-topbar {
    position: sticky;
    z-index: 900;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 58px;
    gap: 10px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--line);
    background: rgba(6,11,18,.96);
    backdrop-filter: blur(12px);
  }

  .mobile-menu-button {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    min-height: 0;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: #102039;
    color: #fff;
  }

  .mobile-brand {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 9px;
  }

  .mobile-brand-mark { flex-basis: 34px; width: 34px; height: 34px; border-radius: 10px; font-size: 17px; }
  .mobile-brand-copy strong { font-size: 16px; }
  .mobile-brand-copy small { margin-top: 2px; color: var(--blue); font-size: 10px; font-weight: 800; }
  .mobile-topbar-spacer { width: 42px; }

  .mobile-nav-overlay {
    position: fixed;
    z-index: 1001;
    inset: 0;
    display: block;
    background: rgba(0,0,0,.62);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--sidebar-transition);
    backdrop-filter: blur(2px);
  }

  body.mobile-nav-open .mobile-nav-overlay {
    opacity: 1;
    pointer-events: auto;
  }

  body.mobile-nav-open { overflow: hidden; }
}

@media (prefers-reduced-motion: reduce) {
  .side,.main,.sidebar-toggle svg,.mobile-nav-overlay,
  .sidebar-brand-copy,.userbox-copy,.nav-label,.nav-section-label {
    transition: none !important;
  }
}
