/* Grouped navigation, quick search, alarm counts and the freshness stamp. */
[hidden]{display:none!important}

/* Sidebar groups */
#nav.nav-grouped{gap:2px}
#nav .nav-group{display:grid;gap:1px}
#nav .nav-group+.nav-group{margin-top:6px}
html[data-theme] #nav button.nav-group-h{display:flex;align-items:center;gap:8px;width:100%;padding:8px 10px 5px;border:0;background:none;box-shadow:none;cursor:pointer;color:var(--faint,#70879c);font-size:10px;font-weight:700;letter-spacing:1.2px;text-transform:uppercase}
html[data-theme] #nav button.nav-group-h:hover{color:var(--txt);background:none}
#nav .nav-group-h span{flex:1;text-align:left}
#nav .nav-group-h .nav-chev{width:14px;height:14px;stroke:currentColor;fill:none;stroke-width:2;transition:transform .15s}
#nav .nav-group.shut .nav-chev{transform:rotate(-90deg)}
#nav .nav-group.shut .nav-items{display:none}
#nav .nav-items{display:grid;gap:1px}
#nav .nav-group:not(.shut) .nav-group-h .nav-badge{display:none!important}

/* Counts */
.nav-count,.nav-badge{margin-left:auto;min-width:20px;padding:1px 6px;border-radius:999px;background:var(--warn-soft,#f59e0b2a);color:var(--a,#f59e0b);font-size:11px;font-weight:800;line-height:17px;text-align:center;font-style:normal;letter-spacing:0}
.nav-count.crit,.nav-badge.crit{background:var(--r,#ef4444);color:#fff}

/* Top bar */
.top-actions{flex-wrap:nowrap}
.noc-search-btn{display:inline-flex;align-items:center;gap:8px;min-width:190px;color:var(--muted)!important;font-weight:500!important}
.noc-search-btn svg{width:15px;height:15px;stroke:currentColor;fill:none;stroke-width:1.8}
.noc-search-btn span{flex:1;text-align:left}
.noc-search-btn kbd,.noc-palette kbd,.noc-keys kbd{font:600 10px/1 Inter,system-ui,sans-serif;padding:3px 5px;border:1px solid var(--line);border-bottom-width:2px;border-radius:5px;background:var(--surface-2,#0d1526);color:var(--muted)}
.noc-alarm-chip{border:0;border-radius:999px;padding:6px 11px;font-size:12px;font-weight:800;cursor:pointer;white-space:nowrap}
.noc-alarm-chip.crit{background:var(--r,#ef4444);color:#fff;animation:nocBlink 2s ease-in-out infinite}
.noc-alarm-chip.warn{background:var(--warn-soft,#f59e0b2a);color:var(--a,#f59e0b)}
@keyframes nocBlink{50%{opacity:.75}}
@media (prefers-reduced-motion:reduce){.noc-alarm-chip.crit{animation:none}}
.noc-fresh{font-size:12px;white-space:nowrap;padding:0 4px;cursor:default}
.noc-fresh.good{color:var(--muted)}
.noc-fresh.warn{color:var(--a)}
.noc-fresh.bad{color:var(--r);font-weight:700}

/* Quick search */
.noc-palette{position:fixed;inset:0;z-index:250;background:#020617a6;display:flex;justify-content:center;align-items:flex-start;padding:12vh 16px 16px}
.noc-palette-box{width:min(640px,100%);background:var(--surface,#111a2c);border:1px solid var(--line);border-radius:14px;box-shadow:0 30px 80px #0008;overflow:hidden}
.noc-palette input{width:100%;border:0;border-bottom:1px solid var(--line);background:transparent;color:var(--txt);padding:16px 18px;font-size:15px;outline:none}
.noc-palette ul{list-style:none;margin:0;padding:6px;max-height:min(56vh,460px);overflow:auto}
.noc-palette li{display:grid;grid-template-columns:62px minmax(0,1fr);column-gap:10px;padding:9px 10px;border-radius:9px;cursor:pointer}
.noc-palette li b{font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.noc-palette li small{grid-column:2;color:var(--muted);font-size:11px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.noc-palette li small:empty{display:none}
.noc-palette li.on{background:var(--accent-soft,#2dd4bf1f)}
.noc-palette li.noc-none{display:block;color:var(--muted);cursor:default}
.noc-kind{grid-row:span 2;align-self:center;font-size:10px;font-weight:700;letter-spacing:.6px;text-transform:uppercase;color:var(--faint)}
.noc-palette-foot{display:flex;gap:16px;padding:9px 14px;border-top:1px solid var(--line);font-size:11px;color:var(--faint)}
.noc-keys td{padding:8px 6px}
.noc-keys td:first-child{white-space:nowrap;width:45%}

@media (max-width:1150px){.noc-search-btn{min-width:0}.noc-search-btn span,.noc-search-btn kbd{display:none}}
@media (max-width:760px){.noc-fresh{display:none}.noc-palette{padding-top:10px}}

/* Keep the top bar on one line: the wall display has its own menu entry. */
.top-title .muted{display:none}
@media (max-width:1700px){.top .wall-link{display:none}}
@media (max-width:1400px){.user-chip{display:none!important}}
#incidentTable td:first-child{white-space:nowrap}
.noc-alarm-chip .noc-short{display:none}
@media (max-width:760px){
  .top-actions{gap:6px}
  .noc-alarm-chip .noc-long{display:none}
  .noc-alarm-chip .noc-short{display:inline}
  #logoutBtn{display:none!important}
  .top h2{font-size:15px}
}
/* Phones: wide tables scroll inside their card instead of the whole page. */
@media (max-width:760px){
  .page .card:has(> table),.page .card.section:has(table){overflow-x:auto}
  .page .search{flex-wrap:wrap}
  .page .search>*{min-width:0;flex:1 1 140px}
}

/* Website admin link: administrators only (the website checks again). */
body:not([data-role="admin"]) .nav-website{display:none!important}

/* NOC OS (/noc/) and the Business app (/office/) are the same page; see
   app-mode.js. The Business app leaves out the network-only parts of the
   frame: collector coverage, the alarm chip, poll freshness and the wall. */
.noc-app-switch{white-space:nowrap;text-decoration:none}
html[data-app="office"] aside .health,
html[data-app="office"] #nocAlarmChip,
html[data-app="office"] #nocFresh,
html[data-app="office"] #livePulse,
html[data-app="office"] .top .wall-link{display:none!important}
@media (max-width:760px){.noc-app-switch{padding-left:9px;padding-right:9px;font-size:12px}}

/* Business app menu, laid out like Splynx: each group is a heading you open
   (Customers, Tickets, Finance...), with its pages indented under it. */
html[data-app="office"] #nav .nav-group+.nav-group{margin-top:2px}
html[data-theme][data-app="office"] #nav button.nav-group-h{padding:9px 10px;font-size:13px;font-weight:600;letter-spacing:0;text-transform:none;color:var(--txt);border-radius:8px}
html[data-theme][data-app="office"] #nav button.nav-group-h:hover{background:var(--surface-3)}
html[data-app="office"] #nav .nav-group:not(.shut)>.nav-group-h .nav-chev{color:var(--accent)}
html[data-app="office"] #nav .nav-items{padding:2px 0 6px}
html[data-theme] #nav a.office-link{display:flex;align-items:center;gap:10px;padding:7px 10px 7px 22px;border-radius:8px;border:1px solid transparent;color:var(--muted);font-size:13px;font-weight:500;text-decoration:none;position:relative}
html[data-theme] #nav a.office-link::before{content:"";position:absolute;left:12px;top:50%;width:4px;height:4px;margin-top:-2px;border-radius:50%;background:currentColor;opacity:.45}
html[data-theme] #nav a.office-link:hover{background:var(--surface-3);color:var(--txt)}
html[data-theme] #nav a.office-link.active{background:var(--accent-soft);color:var(--txt);box-shadow:inset 2px 0 0 var(--accent)}
html[data-theme] #nav a.office-link.active::before{background:var(--accent);opacity:1}
html[data-theme] #nav a.office-link[hidden]{display:none}
html[data-theme] #nav .nav-website.office-link::before{display:none}
/* A group with one page (Dashboard) is just that link, as in Splynx. */
#nav .nav-group.nav-single>.nav-group-h{display:none!important}
#nav .nav-group.nav-single .nav-items{display:grid!important;padding:0}
html[data-theme] #nav .nav-group.nav-single a.office-link{padding-left:10px;color:var(--txt);font-weight:600}
html[data-theme] #nav .nav-group.nav-single a.office-link::before{display:none}
/* The menu takes over from the page's own tab rows and banner, as in Splynx,
   where the left menu is the only way round. */
html[data-app="office"] #subscribers>.rd-hero,
html[data-app="office"] #subscribers .sub-tabs,
html[data-app="office"] #subscribers [aria-label="Finance"].wl-filters{display:none}
