/* TT24_D2_DESKTOP_INTERNAL_SHELL_V1_BEGIN
   Desktop-only internal shell aligned with TT24 Desktop Master V1.
   Scope: Header + Sidebar visual layer only. Mobile <= 880px stays on the existing production shell.
*/

/* This node is new in D2 and is deliberately hidden on the existing mobile shell. */
.tt24-d2-topbar-start { display: flex; align-items: center; gap: 12px; min-width: 0; }
.tt24-d2-topbar-user { display: none; }

@media (min-width: 881px) {
  .tt24-d2-shell {
    --tt24-d2-sidebar-w: 240px;
    min-width: 0;
    min-height: 100vh;
  }

  .tt24-d2-shell .sidebar {
    width: var(--tt24-d2-sidebar-w) !important;
    height: 100vh !important;
    height: 100dvh !important;
    background: linear-gradient(180deg, #0f2b4a 0%, #0b223c 100%) !important;
    color: #fff !important;
    border-left: 0 !important;
    box-shadow: -10px 0 32px rgba(15, 43, 74, .12) !important;
    backdrop-filter: none !important;
    overflow: hidden !important;
  }

  .tt24-d2-shell .sidebar::after {
    width: 132px !important;
    height: 132px !important;
    left: 12px !important;
    bottom: 88px !important;
    opacity: .045 !important;
    filter: grayscale(1) brightness(3.6) !important;
  }

  .tt24-d2-shell .sidebar-head {
    min-height: 72px !important;
    padding: 14px 16px !important;
    gap: 11px !important;
    background: transparent !important;
    border-bottom: 1px solid rgba(255,255,255,.10) !important;
  }

  .tt24-d2-shell .sidebar-head .brand-logo,
  .tt24-d2-shell .sidebar-head .logo.brand-logo {
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    border-radius: 11px !important;
    padding: 4px !important;
    background: #fff !important;
    box-shadow: 0 8px 22px rgba(0,0,0,.18) !important;
  }

  .tt24-d2-shell .sidebar-head .t {
    color: #fff !important;
    font-size: 13.5px !important;
    font-weight: 900 !important;
    line-height: 1.45 !important;
  }

  .tt24-d2-shell .sidebar-head .s {
    color: rgba(255,255,255,.54) !important;
    font-size: 10.5px !important;
    font-weight: 600 !important;
    line-height: 1.55 !important;
  }

  .tt24-d2-shell .nav {
    min-height: 0 !important;
    padding: 10px 10px 14px !important;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,.22) transparent;
  }

  .tt24-d2-shell .nav::-webkit-scrollbar { width: 5px; }
  .tt24-d2-shell .nav::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,.20);
    border-radius: 99px;
  }

  .tt24-d2-shell .nav-sep {
    color: rgba(255,255,255,.42) !important;
    font-size: 10.5px !important;
    font-weight: 800 !important;
    padding: 13px 12px 6px !important;
  }

  .tt24-d2-shell .nav-item {
    width: 100% !important;
    min-height: 40px !important;
    margin: 1px 0 !important;
    padding: 8px 11px !important;
    gap: 9px !important;
    border-radius: 9px !important;
    color: rgba(255,255,255,.72) !important;
    background: transparent !important;
    box-shadow: none !important;
    font-size: 13px !important;
    font-weight: 650 !important;
    line-height: 1.55 !important;
    white-space: normal !important;
    transform: none !important;
  }

  .tt24-d2-shell .nav-item .ico {
    width: 19px !important;
    min-width: 19px !important;
    color: rgba(255,255,255,.52) !important;
    font-size: 15px !important;
  }

  .tt24-d2-shell .nav-item:hover,
  .tt24-d2-shell .nav-parent:hover {
    color: #fff !important;
    background: rgba(255,255,255,.08) !important;
    transform: none !important;
  }

  .tt24-d2-shell .nav-item:hover .ico { color: #fff !important; }

  .tt24-d2-shell .nav-item.active {
    color: #fff !important;
    background: rgba(255,255,255,.105) !important;
    box-shadow: inset -3px 0 0 #c4920a !important;
    font-weight: 800 !important;
  }

  .tt24-d2-shell .nav-item.active .ico { color: #e6bf4d !important; }

  .tt24-d2-shell .nav-group { margin: 2px 0 !important; }
  .tt24-d2-shell .nav-parent {
    color: rgba(255,255,255,.72) !important;
    text-align: right !important;
  }
  .tt24-d2-shell .nav-parent .chev {
    margin-right: auto !important;
    color: rgba(255,255,255,.48) !important;
  }
  .tt24-d2-shell .nav-sublist {
    margin: 2px 14px 5px 0 !important;
    padding: 2px 7px 2px 0 !important;
    border-right: 1px solid rgba(255,255,255,.13) !important;
  }
  .tt24-d2-shell .nav-item.nav-sub {
    min-height: 35px !important;
    padding: 7px 9px !important;
    font-size: 12px !important;
    color: rgba(255,255,255,.60) !important;
  }
  .tt24-d2-shell .nav-item.nav-sub.active { color: #fff !important; }

  /* Keep the active child visible without changing route/navigation logic. */
  .tt24-d2-shell .nav-group:has(.nav-item.active) .nav-sublist { display: block; }
  .tt24-d2-shell .nav-group:has(.nav-item.active) .nav-parent .chev { transform: rotate(180deg); }

  .tt24-d2-shell .tt24-d2-logout {
    color: rgba(255,255,255,.66) !important;
    margin-top: 2px !important;
  }
  .tt24-d2-shell .tt24-d2-logout:hover {
    color: #fff !important;
    background: rgba(220,38,38,.16) !important;
  }

  .tt24-d2-shell .sidebar-foot {
    padding: 10px !important;
    background: rgba(0,0,0,.09) !important;
    border-top: 1px solid rgba(255,255,255,.10) !important;
  }

  .tt24-d2-shell .user-chip {
    min-width: 0 !important;
    padding: 9px 10px !important;
    gap: 9px !important;
    border-radius: 10px !important;
    background: rgba(255,255,255,.07) !important;
    border: 1px solid rgba(255,255,255,.09) !important;
    box-shadow: none !important;
  }
  .tt24-d2-shell .user-chip > div:last-child { min-width: 0 !important; }
  .tt24-d2-shell .user-chip .av {
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
    color: #0f2b4a !important;
    background: #fff !important;
    font-size: 13px !important;
  }
  .tt24-d2-shell .user-chip .nm {
    color: #fff !important;
    font-size: 11.5px !important;
    font-weight: 800 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }
  .tt24-d2-shell .user-chip .rl {
    color: rgba(255,255,255,.48) !important;
    font-size: 10px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  .tt24-d2-shell .main {
    min-width: 0 !important;
    margin-right: var(--tt24-d2-sidebar-w) !important;
  }

  .tt24-d2-shell .topbar {
    height: 62px !important;
    min-height: 62px !important;
    padding: 0 22px !important;
    background: rgba(255,255,255,.94) !important;
    border-bottom: 1px solid #e8ecf1 !important;
    box-shadow: 0 1px 0 rgba(15,43,74,.02) !important;
    backdrop-filter: blur(12px) !important;
    min-width: 0 !important;
  }

  html[data-theme="dark"] .tt24-d2-shell .topbar {
    background: color-mix(in srgb, var(--tt24-bg-surface) 94%, transparent) !important;
    border-bottom-color: var(--tt24-border) !important;
  }

  .tt24-d2-shell .tt24-d2-topbar-start {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 11px;
  }
  .tt24-d2-shell .menu-toggle { display: none !important; }
  .tt24-d2-shell .topbar .page-title {
    min-width: 0 !important;
    color: #0f2b4a !important;
    font-size: 15px !important;
    font-weight: 900 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }
  html[data-theme="dark"] .tt24-d2-shell .topbar .page-title { color: var(--tt24-text-title) !important; }

  .tt24-d2-shell .topbar-brand {
    display: inline-flex !important;
    align-items: center !important;
    margin-inline-start: 3px !important;
    opacity: .72 !important;
  }
  .tt24-d2-shell .topbar-brand img {
    width: 32px !important;
    height: 32px !important;
    max-height: 32px !important;
    object-fit: contain !important;
    filter: none !important;
  }

  .tt24-d2-shell .tt24-d2-topbar-actions {
    min-width: 0 !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
  }

  .tt24-d2-shell .tt24-d2-topbar-user {
    min-width: 0 !important;
    max-width: 230px !important;
    height: 40px !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    padding: 4px 8px 4px 10px !important;
    border: 1px solid #e8ecf1 !important;
    border-radius: 10px !important;
    background: #fff !important;
  }
  html[data-theme="dark"] .tt24-d2-shell .tt24-d2-topbar-user {
    background: var(--tt24-bg-surface) !important;
    border-color: var(--tt24-border) !important;
  }
  .tt24-d2-shell .tt24-d2-topbar-avatar {
    width: 30px !important;
    height: 30px !important;
    min-width: 30px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 8px !important;
    color: #fff !important;
    background: #0f2b4a !important;
    font-size: 12px !important;
    font-weight: 900 !important;
  }
  .tt24-d2-shell .tt24-d2-topbar-identity {
    min-width: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    line-height: 1.25 !important;
  }
  .tt24-d2-shell .tt24-d2-topbar-identity b,
  .tt24-d2-shell .tt24-d2-topbar-identity small {
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }
  .tt24-d2-shell .tt24-d2-topbar-identity b {
    color: #0f2b4a !important;
    font-size: 11.5px !important;
    font-weight: 900 !important;
  }
  .tt24-d2-shell .tt24-d2-topbar-identity small {
    color: #64748b !important;
    font-size: 9.5px !important;
    font-weight: 650 !important;
  }
  html[data-theme="dark"] .tt24-d2-shell .tt24-d2-topbar-identity b { color: var(--tt24-text-title) !important; }
  html[data-theme="dark"] .tt24-d2-shell .tt24-d2-topbar-identity small { color: var(--tt24-text-muted) !important; }

  .tt24-d2-shell .bell,
  .tt24-d2-shell .tt24-theme-toggle {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    min-height: 40px !important;
    border-radius: 10px !important;
  }

  .tt24-d2-shell .content { min-width: 0 !important; }
}

@media print {
  .tt24-d2-topbar-user { display: none !important; }
}
/* TT24_D2_DESKTOP_INTERNAL_SHELL_V1_END */
