:root{
  --kad-shell-z: 3500;
  --kad-shell-peek: 26px;
  --kad-shell-open-width: 220px;
  --kad-shell-gap: 16px;
  --kad-shell-panel-width: 580px;
  --kad-shell-space: calc(var(--kad-shell-peek) + 8px);
  --kad-shell-bg: rgba(33,22,56,.90);
  --kad-shell-bg-2: rgba(52,38,86,.94);
  --kad-shell-border: rgba(143,122,210,.26);
  --kad-shell-divider: rgba(190,174,236,.18);
  --kad-shell-text: #eef4ff;
  --kad-shell-muted: rgba(222,232,255,.68);
  --kad-shell-shadow: 0 26px 64px rgba(32,20,58,.34);
  --kad-shell-surface: rgba(255,255,255,.045);
  --kad-shell-surface-hover: rgba(32,72,150,.88);
  --kad-shell-surface-border: rgba(122,146,204,.18);
  --kad-shell-caret: rgba(231,239,255,.84);
  --kad-shell-scroll: rgba(82,110,176,.34);
  --kad-shell-shine-1: rgba(255,255,255,.06);
  --kad-shell-shine-2: rgba(156,132,216,.12);
  --kad-shell-accent: #4f82dc;
  --kad-shell-accent-2: #6a99ea;
}

body.kad-shell-mounted{
  overflow-x: hidden;
}

body.kad-shell-mounted .kad-shell-page-content{
  position: relative;
  height: 100vh;
  min-height: 100vh;
  margin-left: var(--kad-shell-space);
  width: calc(100vw - var(--kad-shell-space));
  max-width: calc(100vw - var(--kad-shell-space));
  transition: margin-left .22s ease, width .22s ease, max-width .22s ease;
}

body.kad-shell-mounted.kad-shell-open{
  --kad-shell-space: calc(var(--kad-shell-open-width) + 12px);
}

body.kad-shell-mounted.kad-shell-open.kad-shell-submenu{
  --kad-shell-space: calc(var(--kad-shell-panel-width) + 14px);
}

#kadNavShellRoot{
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: var(--kad-shell-z);
  font-family: "Segoe UI", Tahoma, Arial, sans-serif;
}

.kad-shell-edge-sensor{
  position: fixed;
  left: 0;
  top: 0;
  width: calc(var(--kad-shell-peek) + 8px);
  height: 100vh;
  pointer-events: auto;
  cursor: pointer;
  z-index: calc(var(--kad-shell-z) + 1);
}

.kad-shell{
  position: fixed;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: var(--kad-shell-open-width);
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  color: var(--kad-shell-text);
  background:
    radial-gradient(120% 120% at 0% 0%, rgba(154,130,214,.26), transparent 35%),
    linear-gradient(180deg, var(--kad-shell-bg), var(--kad-shell-bg-2));
  border: 1px solid var(--kad-shell-border);
  border-left: 0;
  border-radius: 0 24px 24px 0;
  box-shadow: var(--kad-shell-shadow);
  backdrop-filter: blur(16px) saturate(120%);
  -webkit-backdrop-filter: blur(16px) saturate(120%);
  transform: translateX(calc(-100% + var(--kad-shell-peek)));
  transition: transform .22s ease, width .22s ease, box-shadow .22s ease;
  overflow: hidden;
}

#kadNavShellRoot.is-open .kad-shell{
  transform: translateX(0);
}

#kadNavShellRoot.has-submenu .kad-shell{
  width: var(--kad-shell-panel-width);
}

.kad-shell::before{
  content:"";
  position:absolute;
  inset:0;
  background: linear-gradient(135deg, var(--kad-shell-shine-1), transparent 38%, transparent 72%, var(--kad-shell-shine-2));
  pointer-events:none;
}
.kad-shell::after{
  content:"";
  position:absolute;
  right:0;
  top:16px;
  bottom:16px;
  width:1px;
  background: linear-gradient(180deg, transparent, rgba(255,255,255,.18), transparent);
  pointer-events:none;
}

.kad-shell-header,
.kad-shell-footer,
.kad-shell-navcol,
.kad-shell-subpanel{
  position: relative;
  z-index: 1;
}

.kad-shell-header{
  padding: 6px 8px 12px 8px;
  border-bottom: 1px solid var(--kad-shell-divider);
}

.kad-shell-mini{
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .18em;
  font-weight: 800;
  color: var(--kad-shell-muted);
  margin-bottom: 6px;
}

.kad-shell-brand{
  font-size: 19px;
  font-weight: 900;
  letter-spacing: .18em;
  color: var(--kad-shell-text);
}

.kad-shell-current{
  display: inline-flex;
  align-items: center;
  margin-top: 8px;
  padding: 7px 11px;
  border-radius: 999px;
  border: 1px solid rgba(88,121,196,.28);
  background: linear-gradient(180deg, rgba(37,70,145,.78), rgba(19,39,83,.72));
  color: var(--kad-shell-text);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 0 0 1px rgba(79,130,220,.12);
  font-size: 11px;
  font-weight: 900;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kad-shell-layout{
  min-height: 0;
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: 188px 1fr;
  gap: 12px;
  overflow: hidden;
}

.kad-shell-navcol{
  min-width: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 3px;
}

.kad-shell-navcol::-webkit-scrollbar,
.kad-shell-subpanel::-webkit-scrollbar{ width:8px; }
.kad-shell-navcol::-webkit-scrollbar-thumb,
.kad-shell-subpanel::-webkit-scrollbar-thumb{ background: var(--kad-shell-scroll); border-radius:999px; }
.kad-shell-navcol::-webkit-scrollbar-track,
.kad-shell-subpanel::-webkit-scrollbar-track{ background: transparent; }

.kad-shell-subpanel{
  display: none;
  min-width: 0;
  overflow-y: auto;
  overflow-x: hidden;
  border-left: 1px solid var(--kad-shell-divider);
  padding-left: 14px;
}

#kadNavShellRoot.has-submenu .kad-shell-subpanel{ display:block; }

.kad-shell-item{ margin-bottom: 8px; }

.kad-shell-main{
  appearance: none;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 52px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--kad-shell-surface-border);
  background: var(--kad-shell-surface);
  color: var(--kad-shell-text);
  text-decoration: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: .02em;
  text-align: left;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05);
  transition: background .15s ease, border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
button.kad-shell-main{ font-family: inherit; }
.kad-shell-main:hover,
.kad-shell-main:focus-visible,
.kad-shell-item.is-open > .kad-shell-main{
  background: var(--kad-shell-surface-hover);
  border-color: rgba(79,130,220,.72);
  box-shadow: 0 12px 22px rgba(6,14,34,.34), inset 0 1px 0 rgba(255,255,255,.08);
  transform: translateX(3px);
  outline: none;
}
.kad-shell-item.is-active > .kad-shell-main{
  background: linear-gradient(180deg, rgba(46,84,167,.96), rgba(24,52,110,.92));
  border-color: rgba(121,165,255,.78);
  box-shadow: 0 14px 28px rgba(4,10,28,.42), inset 0 0 0 1px rgba(255,255,255,.06);
  transform: translateX(4px);
}
.kad-shell-item.is-active > .kad-shell-main::before,
.kad-shell-link.is-active::before{
  content:"";
  position:absolute;
  left:-1px;
  top:8px;
  bottom:8px;
  width:4px;
  border-radius:999px;
  background: linear-gradient(180deg, var(--kad-shell-accent-2), var(--kad-shell-accent));
  box-shadow: 0 0 12px rgba(126,162,255,.45);
}

.kad-shell-main-label{ flex: 1 1 auto; min-width: 0; }
.kad-shell-main-caret{
  margin-left: 10px;
  width: 9px;
  height: 9px;
  border-right: 2px solid var(--kad-shell-caret);
  border-bottom: 2px solid var(--kad-shell-caret);
  transform: rotate(-45deg);
  transition: transform .18s ease;
}
.kad-shell-item.is-open > .kad-shell-main .kad-shell-main-caret{ transform: rotate(45deg); }

.kad-shell-subtitle{
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .16em;
  font-weight: 800;
  color: var(--kad-shell-muted);
  margin: 4px 0 12px;
}

.kad-shell-section{ margin-bottom: 16px; }
.kad-shell-section:last-child{ margin-bottom: 0; }
.kad-shell-section-label{
  font-size: 12px;
  font-weight: 900;
  color: var(--kad-shell-text);
  margin: 0 0 8px;
}

.kad-shell-link-grid{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 8px;
}

.kad-shell-link{
  position: relative;
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 9px 11px 9px 14px;
  border-radius: 12px;
  border: 1px solid var(--kad-shell-surface-border);
  background: var(--kad-shell-surface);
  color: var(--kad-shell-text);
  text-decoration: none;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  transition: background .15s ease, border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.kad-shell-link:hover,
.kad-shell-link:focus-visible,
.kad-shell-link.is-active{
  background: var(--kad-shell-surface-hover);
  border-color: rgba(79,130,220,.72);
  box-shadow: 0 10px 18px rgba(20,32,70,.18);
  transform: translateX(3px);
  outline: none;
}
.kad-shell-link.is-active{
  color: var(--kad-shell-text);
  font-weight: 900;
}
.kad-shell-link[aria-disabled="true"]{
  opacity: .55;
  pointer-events: none;
}

.kad-shell-footer{
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid var(--kad-shell-divider);
  display: grid;
  gap: 8px;
}

.kad-shell-logout{
  appearance: none;
  min-height: 44px;
  border-radius: 12px;
  border: 1px solid rgba(255,120,120,.18);
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.03));
  color: var(--kad-shell-text);
  font-weight: 900;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, transform .15s ease;
}
.kad-shell-logout:hover,
.kad-shell-logout:focus-visible{
  background: linear-gradient(180deg, rgba(255,108,108,.18), rgba(255,108,108,.10));
  border-color: rgba(255,120,120,.30);
  transform: translateY(-1px);
  outline:none;
}

.kad-shell-note{
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--kad-shell-muted);
  text-align: center;
}

.kad-shell-peek-label{
  position: absolute;
  right: 2px;
  top: 50%;
  transform: translateY(-50%);
  writing-mode: vertical-rl;
  text-orientation: mixed;
  letter-spacing: .24em;
  font-size: 10px;
  font-weight: 900;
  color: var(--kad-shell-muted);
  pointer-events: none;
}

@media (max-width: 980px){
  body.kad-shell-mounted.kad-shell-open.kad-shell-submenu{
    --kad-shell-space: calc(min(92vw, 520px) + 8px);
  }
  .kad-shell{ width: min(var(--kad-shell-open-width), calc(100vw - 42px)); }
}
