/*
 * AomTang InterSite Pro V2 — Admin V3 Shell Standard R1
 *
 * Visual authority: Radius Admin V3 production shell.
 * Scope: global header, primary navigation, module sidebar and shell frame.
 * Business-page content remains owned by each V2 workspace.
 */

:root {
  --shell-topbar-height: 56px;
  --shell-primary-height: 48px;
  --shell-sidebar-width: 168px;
  --shell-section-header-height: 40px;
  --shell-page-gutter: 20px;
  --shell-deep: #143f69;
  --shell-deeper: #103654;
  --shell-blue: #168dc4;
  --shell-cyan: #17a9e3;
  --shell-line: #718ba2;
  --shell-page: #eef4f8;
  --shell-text: #172235;
  --shell-muted: #6e819a;
  --shell-menu-top: #83bddb;
  --shell-menu-bottom: #6fadd0;
  --shell-menu-hover-top: #91c7e0;
  --shell-menu-hover-bottom: #7ab8d7;
  --shell-active-rail: #145487;
}

body.noc-authenticated {
  height: 100vh;
  min-height: 100vh;
  display: grid;
  grid-template-rows:
    var(--shell-topbar-height)
    var(--shell-primary-height)
    minmax(0, 1fr)
    28px;
  overflow: hidden;
  background: linear-gradient(180deg, #f1f6fa 0%, #eaf1f6 100%);
  color: var(--shell-text);
}

/* Global system header */

.noc-authenticated .topbar {
  position: relative;
  z-index: 60;
  box-sizing: border-box;
  width: 100%;
  height: var(--shell-topbar-height);
  min-height: var(--shell-topbar-height);
  max-height: var(--shell-topbar-height);
  padding: 0 20px;
  border: 0;
  background: linear-gradient(180deg, #164b77 0%, #103c65 100%);
  box-shadow: none;
}

.noc-authenticated .topbar::after {
  display: none;
}

.noc-authenticated .brand-home {
  height: 100%;
  gap: 0;
}

.noc-authenticated .brand-title {
  color: #ffffff;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.1;
  text-shadow: none;
}

.noc-authenticated .brand-subtitle {
  margin-top: 2px;
  color: #c8d8e6;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0;
}

.noc-authenticated .top-actions {
  gap: 10px;
}

.system-clock {
  display: grid;
  justify-items: end;
  min-width: 178px;
  line-height: 1.1;
}

.system-clock-label {
  color: #b9ccdc;
  font-size: 9.5px;
  font-weight: 650;
}

.system-clock time {
  margin-top: 3px;
  color: #ffffff;
  font-size: 12px;
  font-weight: 760;
  font-variant-numeric: tabular-nums;
}

.noc-authenticated .language {
  box-sizing: border-box;
  height: 36px;
  padding: 2px;
  border-radius: 8px;
}

.noc-authenticated .language button {
  height: 30px;
  min-width: 40px;
  border-radius: 6px;
  font-size: 11px;
}

.noc-authenticated .user-menu summary {
  box-sizing: border-box;
  height: 36px;
  min-width: 118px;
  padding: 0 10px;
  border-radius: 8px;
  font-size: 12px;
}

.noc-authenticated .user-avatar {
  width: 24px;
  height: 24px;
  font-size: 11px;
}

.noc-authenticated .user-pop {
  top: 42px;
}

/* Admin V3 primary module navigation */

.noc-authenticated .primary-nav {
  position: relative;
  z-index: 55;
  box-sizing: border-box;
  width: 100%;
  height: var(--shell-primary-height);
  min-height: var(--shell-primary-height);
  max-height: var(--shell-primary-height);
  padding: 0 20px;
  gap: 0;
  overflow-x: auto;
  overflow-y: hidden;
  border-top: 2px solid rgba(22, 166, 217, .70);
  border-bottom: 1px solid var(--shell-line);
  background: linear-gradient(180deg, #1a4f7d 0%, #143f69 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .05),
    0 4px 10px rgba(22, 57, 88, .08);
  scrollbar-width: thin;
}

.noc-authenticated .primary-nav .nav-item {
  flex: 0 0 auto;
  min-width: 118px;
  height: 100%;
  padding: 0 13px;
  gap: 8px;
  border: 0;
  color: #d1deea;
  font-size: 13px;
  font-weight: 720;
  line-height: 1;
}

.noc-authenticated .primary-nav .nav-item:hover:not(.disabled) {
  color: #ffffff;
  background: rgba(21, 134, 198, .18);
}

.noc-authenticated .primary-nav .nav-item.active {
  color: #ffffff;
  border-left: 1px solid rgba(75, 187, 238, .24);
  border-right: 1px solid rgba(75, 187, 238, .24);
  background: linear-gradient(
    180deg,
    rgba(20, 151, 217, .34) 0%,
    rgba(12, 116, 184, .23) 100%
  );
}

.noc-authenticated .primary-nav .nav-item.active::after {
  height: 4px;
  bottom: -1px;
  background: var(--shell-cyan);
  box-shadow: 0 -3px 9px rgba(23, 169, 227, .24);
}

.noc-authenticated .primary-nav .nav-icon {
  box-sizing: border-box;
  width: 21px;
  height: 21px;
  flex: 0 0 21px;
  padding: 3px;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 5px;
}

.noc-authenticated .primary-nav .nav-icon svg {
  width: 15px;
  height: 15px;
  stroke-width: 1.8;
}

.noc-authenticated .primary-nav .nav-refresh {
  min-width: 100px;
  margin-left: auto;
  color: #a6e56d;
}

/* Global workspace frame */

.noc-authenticated .page-main {
  min-width: 0;
  min-height: 0;
  padding: 14px var(--shell-page-gutter) 10px;
  overflow: hidden;
}

.app-shell {
  box-sizing: border-box;
  display: grid;
  grid-template-columns: var(--shell-sidebar-width) minmax(0, 1fr);
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border: 1.5px solid var(--shell-line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 4px 16px rgba(35, 58, 74, .05);
}

.app-sidebar {
  position: relative;
  z-index: 2;
  box-sizing: border-box;
  width: var(--shell-sidebar-width);
  min-width: var(--shell-sidebar-width);
  max-width: var(--shell-sidebar-width);
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  background: linear-gradient(180deg, #7fb9d8 0%, #6da8ca 100%);
  scrollbar-width: thin;
}

.app-sidebar-mobile-head {
  display: none;
}

.app-sidebar-group {
  width: 100%;
}

.app-sidebar-title,
.app-sidebar-link {
  box-sizing: border-box;
  display: flex;
  width: 100%;
  min-width: 0;
  align-items: center;
  gap: 10px;
  padding: 0 12px 0 15px;
  line-height: 1;
  white-space: nowrap;
}

.app-sidebar-title {
  height: 40px;
  min-height: 40px;
  color: #ffffff;
  border-bottom: 1.5px solid rgba(20, 63, 105, .24);
  background: linear-gradient(180deg, #1a4f7d 0%, #143f69 100%);
  font-size: 12px;
  font-weight: 700;
}

.app-sidebar-title-icon,
.app-sidebar-link-icon {
  display: inline-flex;
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  align-items: center;
  justify-content: center;
}

.app-sidebar-title-icon svg,
.app-sidebar-link-icon svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.app-sidebar-title-icon svg path[d*="h6v6"] {
  fill: currentColor;
  stroke: none;
}

.app-sidebar-link {
  position: relative;
  width: calc(100% + 1.5px);
  height: 34px;
  min-height: 34px;
  margin-left: -1.5px;
  color: #f6fbff;
  border-left: 1.5px solid rgba(20, 63, 105, .38);
  border-bottom: 1.5px solid rgba(20, 63, 105, .24);
  border-radius: 0 0 0 9px;
  background: linear-gradient(
    135deg,
    rgba(87, 173, 219, .72) 0%,
    rgba(69, 151, 201, .70) 42%,
    rgba(52, 132, 186, .68) 70%,
    rgba(40, 116, 172, .66) 100%
  );
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
}

.app-sidebar-link:hover {
  color: #ffffff;
  background: linear-gradient(
    135deg,
    rgba(87, 173, 219, .84) 0%,
    rgba(69, 151, 201, .82) 42%,
    rgba(52, 132, 186, .80) 70%,
    rgba(40, 116, 172, .78) 100%
  );
}

.app-sidebar-link.is-active,
.app-sidebar-link.is-active:hover,
.app-sidebar-parent.is-family-active,
.app-sidebar-parent.is-family-active:hover {
  position: relative;
  z-index: 2;
  overflow: visible;
  color: #173f6d;
  border-left: 0;
  border-bottom-color: #d5e0e8;
  border-radius: 0 0 0 9px;
  background: #ffffff;
  box-shadow:
    inset 4px 0 0 #1a4f7d,
    3px 0 0 #ffffff;
  font-weight: 700;
}

.app-sidebar-link.is-active::before,
.app-sidebar-parent.is-family-active::before {
  content: "";
  display: block;
  position: absolute;
  top: -9px;
  left: 0;
  right: auto;
  bottom: auto;
  width: 10px;
  height: 9px;
  border: 0;
  border-radius: 0;
  background: linear-gradient(
    90deg,
    #1a4f7d 0,
    #1a4f7d 4px,
    #ffffff 4px,
    #ffffff 100%
  );
  -webkit-mask-image: radial-gradient(
    circle at 9px 0,
    transparent 0,
    transparent 8.4px,
    rgba(0, 0, 0, .45) 8.8px,
    #000000 9.2px,
    #000000 100%
  );
  mask-image: radial-gradient(
    circle at 9px 0,
    transparent 0,
    transparent 8.4px,
    rgba(0, 0, 0, .45) 8.8px,
    #000000 9.2px,
    #000000 100%
  );
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  box-shadow: none;
  pointer-events: none;
  z-index: 6;
}

.app-sidebar-link.is-active::after,
.app-sidebar-parent.is-family-active::after {
  content: none;
  display: none;
}

/* Admin V3 nested navigation: functional submenus live in the sidebar,
   while CRUD modes stay in the page workspace. */

.app-sidebar-subgroup {
  width: 100%;
  margin: 0;
}

.app-sidebar-subgroup > summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
}

.app-sidebar-subgroup > summary::-webkit-details-marker {
  display: none;
}

.app-sidebar-chevron {
  margin-left: auto;
  color: rgba(255, 255, 255, .86);
  font-size: 17px;
  line-height: 1;
  transform: rotate(0deg);
  transition: transform 140ms ease;
}

.app-sidebar-parent.is-family-active .app-sidebar-chevron {
  color: #173f6d;
}

.app-sidebar-subgroup[open] .app-sidebar-chevron {
  transform: rotate(90deg);
}

.app-sidebar-children {
  position: relative;
  box-sizing: border-box;
  width: calc(100% - 10px);
  margin-left: 10px;
  background: transparent;
}

.app-sidebar-link.app-sidebar-child {
  width: 100%;
  height: 34px;
  min-height: 34px;
  margin-left: 0;
  padding-left: 42px;
  border-bottom-color: rgba(20, 63, 105, .18);
  background: linear-gradient(
    135deg,
    #86c1e3 0%,
    #79b6db 42%,
    #6eadd3 70%,
    #68a6ce 100%
  );
  font-size: 11.5px;
  font-weight: 600;
}

.app-sidebar-child-marker {
  position: absolute;
  left: 15px;
  top: 50%;
  width: 12px;
  height: 12px;
  transform: translateY(-50%);
  border: 1px solid rgba(255, 255, 255, .46);
  border-radius: 1px;
  background: #168dc4;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .10);
}

.app-sidebar-link.app-sidebar-child.is-active {
  color: #173f6d;
  background: #ffffff;
  box-shadow:
    inset 4px 0 0 #1a4f7d,
    3px 0 0 #ffffff;
  font-weight: 700;
}

.app-sidebar-link.app-sidebar-child.is-active .app-sidebar-child-marker {
  border-color: rgba(23, 63, 109, .20);
  background: #1a4f7d;
}

.app-sidebar-link.app-sidebar-child:not(.is-active):hover {
  background: linear-gradient(
    135deg,
    #7db9de 0%,
    #72afd7 42%,
    #67a6cf 70%,
    #619fca 100%
  );
}

.app-sidebar-subgroup[open]
.app-sidebar-children
> .app-sidebar-child:first-child.is-active::before {
  content: none;
  display: none;
}

.app-sidebar-link.is-disabled {
  color: rgba(239, 248, 255, .56);
  cursor: default;
  pointer-events: none;
}

.app-main,
.app-content {
  min-width: 0;
  min-height: 0;
}

.app-main {
  overflow: hidden;
  background: #ffffff;
}

.app-content {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

/* Keep the content-sheet header on the same horizontal baseline as the
   40px module heading in the global sidebar. */

.noc-authenticated .app-content .monitoring-vertical-header,
.noc-authenticated .app-content .noc-sheet-header {
  flex: 0 0 var(--shell-section-header-height) !important;
  height: var(--shell-section-header-height) !important;
  min-height: var(--shell-section-header-height) !important;
  max-height: var(--shell-section-header-height) !important;
  grid-template-columns: minmax(0, 1fr) !important;
  background: #ffffff !important;
  border-bottom: 1.5px solid var(--shell-line) !important;
}

.noc-authenticated
.app-content
.monitoring-vertical-header
> .noc-sheet-title,
.noc-authenticated
.app-content
.noc-sheet-header
> .noc-sheet-title {
  box-sizing: border-box !important;
  display: grid !important;
  width: 100% !important;
  height: var(--shell-section-header-height) !important;
  min-height: var(--shell-section-header-height) !important;
  max-height: var(--shell-section-header-height) !important;
  grid-template-columns: minmax(0, 1fr) !important;
  grid-template-rows: 18px 10px !important;
  align-content: center !important;
  row-gap: 1px !important;
  padding: 0 14px 3px !important;
  border-bottom: 0 !important;
  overflow: hidden !important;
}

.noc-authenticated
.app-content
.noc-sheet-title h1 {
  grid-column: 1 !important;
  grid-row: 1 !important;
  height: 18px !important;
  color: #17263a !important;
  font-size: 16px !important;
  font-weight: 800 !important;
  line-height: 18px !important;
  margin: 0 !important;
  padding: 0 !important;
  transform: none !important;
}

.noc-authenticated
.app-content
.noc-sheet-title p {
  grid-column: 1 !important;
  grid-row: 2 !important;
  height: 10px !important;
  max-width: 760px !important;
  color: #698096 !important;
  font-size: 9px !important;
  font-weight: 500 !important;
  line-height: 10px !important;
  margin: 0 !important;
  padding: 0 !important;
  transform: none !important;
}

/* Settings used a legacy three-column title/tab rail and removed the header
   border. The shared shell has no page-mode tabs, so the title and divider
   must occupy the complete right-hand workspace. */
.noc-authenticated
.app-content
.settings-vertical-main
> .noc-sheet-workspace
> .noc-sheet-header {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  background: #ffffff !important;
  border: 0 !important;
  border-bottom: 1.5px solid var(--shell-line) !important;
}

.noc-authenticated
.app-content
.settings-vertical-main
> .noc-sheet-workspace
> .noc-sheet-header
> .noc-sheet-title {
  width: 100% !important;
  border: 0 !important;
}

/* Existing V2 pages already contain a module navigator. The global shell
   now owns that responsibility, so the legacy navigator becomes inert. */

.noc-authenticated .app-content > .monitoring-vertical-workspace {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

.noc-authenticated
.app-content
> .monitoring-vertical-workspace
> .monitoring-vertical-nav {
  display: none !important;
}

.noc-authenticated
.app-content
> .monitoring-vertical-workspace
> .monitoring-vertical-main {
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
}

.noc-authenticated .app-content > .workspace {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.shell-sidebar-toggle,
.shell-sidebar-backdrop {
  display: none;
}

/* Responsive navigation follows the Admin V3 drawer contract. */

@media (max-width: 900px) {
  .system-clock {
    display: none;
  }

  .shell-sidebar-toggle {
    display: grid;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    place-content: center;
    gap: 4px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, .28);
    border-radius: 7px;
    background: rgba(255, 255, 255, .08);
  }

  .shell-sidebar-toggle span {
    display: block;
    width: 17px;
    height: 2px;
    border-radius: 999px;
    background: #ffffff;
  }

  .app-shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .app-sidebar {
    position: fixed;
    top: calc(var(--shell-topbar-height) + var(--shell-primary-height));
    bottom: 28px;
    left: 0;
    z-index: 80;
    width: min(300px, 86vw);
    min-width: 0;
    max-width: none;
    transform: translateX(-105%);
    transition: transform 160ms ease;
    box-shadow: 12px 0 30px rgba(15, 35, 55, .22);
  }

  .app-sidebar-mobile-head {
    box-sizing: border-box;
    display: flex;
    height: 44px;
    align-items: center;
    justify-content: space-between;
    padding: 0 10px 0 14px;
    color: #ffffff;
    background: var(--shell-deeper);
  }

  .app-sidebar-mobile-head button {
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 6px;
    background: rgba(255, 255, 255, .10);
    color: #ffffff;
    font-size: 22px;
  }

  .shell-sidebar-open .app-sidebar {
    transform: translateX(0);
  }

  .shell-sidebar-backdrop {
    position: fixed;
    inset: calc(var(--shell-topbar-height) + var(--shell-primary-height)) 0 28px;
    z-index: 75;
    background: rgba(15, 35, 55, .36);
  }

  .shell-sidebar-open .shell-sidebar-backdrop {
    display: block;
  }
}

@media (max-width: 680px) {
  :root {
    --shell-page-gutter: 8px;
  }

  .noc-authenticated .topbar {
    padding: 0 10px;
  }

  .noc-authenticated .brand-title {
    font-size: 13px;
  }

  .noc-authenticated .brand-subtitle {
    font-size: 9px;
  }

  .noc-authenticated .language {
    display: none;
  }

  .noc-authenticated .user-menu summary {
    min-width: 0;
  }

  .noc-authenticated .user-menu summary > span:nth-child(2) {
    display: none;
  }

  .noc-authenticated .primary-nav {
    padding: 0 8px;
  }

  .noc-authenticated .primary-nav .nav-item {
    min-width: 104px;
    padding: 0 9px;
    font-size: 12px;
  }

  .noc-authenticated .page-main {
    padding-top: 8px;
    padding-bottom: 8px;
  }
}
