/*
 * SimpleFiber Apps — minimal NetSapiens Manager Portal CSS.
 * BUILD_TAG: hub-css-2026-09-14d
 *
 * Loaded via NS Platform Setting PORTAL_CSS_CUSTOM ->
 *   https://portal-assets.simplefiber.com/portal-custom.css
 * (needs https://portal-assets.simplefiber.com in PORTAL_CSP_STYLE_ADDITIONS;
 *  the sprite below may also need it in the img-src additions if NS reports
 *  a violation — check the console after repointing).
 *
 * What this file does (unchanged since round 5, Zack 2026-04-27):
 *   ONE thing - point ALL nav-button icons (.nav-bg-image) at our
 *   mirrored copy of NS's sprite, into which we've added one icon at
 *   cell (592,120) (the only empty cell in NS's 9x3 grid). Native icons
 *   stay pixel-identical because our sprite IS NS's sprite with one
 *   cell filled in.
 *
 *   Tile chrome (gradient, hover, current-page color, border, radius)
 *   is left to NS's stock styling, driven by the standard
 *   PORTAL_CSS_PRIMARY_1 / _2 / _3 UICONFIG variables. Header, sub-bar,
 *   dropdowns, login - all NS native + UICONFIG.
 *
 *   Since the 2026-09-14 hub rev the portal entry lives in the Apps
 *   dropdown, which NS styles itself. This file only matters when
 *   portal-inject.js falls back to a #nav-buttons tile (older portal
 *   builds without ul#app-menu-list).
 *
 *   When NS ships a portal update with new tabs, those tabs will render
 *   blank icons until we re-mirror NS's sprite. Sprite source:
 *   https://talk.simplefiber.com/portal/img/nav/navigation-background.png.
 *   Re-mirror with C:/temp/build-nav-sprite.py (preserved in repo).
 *
 * Hard-refresh any Manager Portal page to apply changes.
 */

/* ── Global nav-icon sprite override ───────────────────────────────── */
/* NS's stock CSS sets .nav-bg-image background-image to
   /portal/img/nav/navigation-background.png. We override it to our
   mirrored copy so our tile (which references position -592px -120px
   below) finds its icon in the same canvas as everything else. Per-tile
   background-position values (set by NS's stock CSS for each #nav-* id)
   continue to crop the correct icon - we haven't moved any of NS's
   existing icons, just filled in cell (592,120). */
.nav-bg-image {
  background-image: url('https://portal-assets.simplefiber.com/nav-sprite.png') !important;
}

/* ── SimpleFiber Apps fallback tile ────────────────────────────────── */
/* Injected as <li id="sf-apps-nav"> by portal-inject.js only when the
   Apps dropdown is absent. The legacy ids from earlier builds are kept
   so a stale cached script still gets an icon. NS has no #nav-* rule
   pinning a background-position for these, so we set it here to crop
   the filled-in cell. */
/* The SimpleFiber Apps tile icon: the composite mark (mind / message /
   vault around a dotted ring), white to match the icons NS crops from the
   sprite for every other tile. Served as a static SVG from portal-assets
   (same host + img-src the nav sprite already loads from). The id selector
   + !important beat the global .nav-bg-image sprite rule above. */
#sf-apps-nav .nav-bg-image {
  background-image: url("https://portal-assets.simplefiber.com/apps-mark.svg?v=2") !important;
  background-position: center !important;
  background-size: 54px 54px !important;
  background-repeat: no-repeat !important;
}

/* Top-right toolbar link (Option C). NS toolbar links are blue text; the
   grid glyph inherits that via currentColor. */
#sf-apps-toolbar { display: inline-flex; align-items: center; }
a.sf-apps-toolbar-link {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
}
a.sf-apps-toolbar-link svg { flex: 0 0 auto; }
