/* Sundowners ERP — shared navigation 1.1.1 (Dec. 4, 2026). Loaded by every app with nav.js. Display only. 1.0.1: every class is prefixed erp- (R&P's own .sheet deformed the phone menu); no scrollbar on the sidebar.
   Desktop (> 900 px): a dark sidebar on the left (the page is pushed right with a padding on <html>).
   Phone: a slim bar on top (Home · app name · menu) — the apps keep their own bottom tabs.
   Live for everyone since 2.0.0 (Dec. 4, 2026). */
html.erp-nav { --erp-side-w: 236px; --erp-top-h: 46px;
  --erp-side: #17322b; --erp-side-ink: #e9efe8; --erp-side-muted: #9fb3aa; --erp-side-hover: rgba(255, 255, 255, .08);
  --erp-accent: #2f6f5a; --erp-warn: #b4541e; }
html.erp-nav.erp-r-SVV { --erp-side: #163a47; --erp-accent: #1f7389; }
html.erp-nav.erp-r-CIAO { --erp-side: #0d1011; --erp-accent: #17a556; } /* 2.0.1: CIAO = the near-black menu of the CIAO app */
html.erp-nav.erp-r-CIAO #erpNav { font-family: Inter, 'Segoe UI', system-ui, sans-serif; }

#erpNav { font-family: 'Manrope', 'Segoe UI', system-ui, sans-serif; font-size: 13.5px; line-height: 1.4; color: var(--erp-side-ink); -webkit-font-smoothing: antialiased; box-sizing: border-box; }
#erpNav *, #erpNav *::before, #erpNav *::after { box-sizing: border-box; }
#erpNav a { color: inherit; text-decoration: none; }
#erpNav button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
#erpNav button, #erpNav a, #erpNav span, #erpNav div, #erpNav aside, #erpNav img, #erpNav b, #erpNav small { margin: 0; padding: 0; background: none; border: 0; box-shadow: none; text-align: left; position: static; width: auto; height: auto; max-width: none; flex-shrink: 0; inset: auto; transform: none; float: none; }
#erpNav .erp-hid { display: none !important; }

#erpNav .erp-side::-webkit-scrollbar { display: none; }
/* ---- the sidebar (desktop) ---- */
#erpNav .erp-side { position: fixed; scrollbar-width: none; left: 0; top: 0; bottom: 0; width: var(--erp-side-w); z-index: 900; overflow-y: auto; scrollbar-width: thin;
  background: var(--erp-side); display: flex; flex-direction: column; gap: 4px; padding: 14px 10px 16px; }
#erpNav .erp-brand { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 10px; padding: 2px 6px 10px; }
#erpNav .erp-brand img { height: 32px; width: auto; background: #fff; border-radius: 8px; padding: 3px; }
#erpNav .erp-brand > div { min-width: 0; overflow: hidden; }
#erpNav .erp-brand b { font-size: 13px; line-height: 1.15; display: block; letter-spacing: -.2px; white-space: normal; overflow-wrap: anywhere; }
#erpNav .erp-brand small { color: var(--erp-side-muted); font-size: 11.5px; display: block; margin-top: 2px; white-space: normal; overflow-wrap: anywhere; }
#erpNav .erp-rsel { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 2px; padding: 3px; border-radius: 11px; background: rgba(255, 255, 255, .1); margin: 0 2px 8px; }
#erpNav .erp-rsel button { font-size: 12.5px; font-weight: 700; text-decoration: none; line-height: 1.3; text-align: center; color: var(--erp-side-muted); padding: 6px 4px; border-radius: 8px; white-space: nowrap; }
#erpNav .erp-rsel button[aria-selected="true"] { background: #fff; color: var(--erp-accent); }
#erpNav a.erp-nl { display: grid !important; grid-template-columns: 24px 1fr auto; align-items: center; gap: 9px; padding: 7px 8px; border-radius: 9px; font-weight: 600; }
#erpNav a.erp-nl .erp-i { font-size: 16px; text-align: center; line-height: 1; }
#erpNav a.erp-nl:hover { background: var(--erp-side-hover); }
#erpNav a.erp-nl[aria-current="page"] { background: var(--erp-accent); color: #fff; }
#erpNav a.erp-nl .erp-k { font-size: 10px; font-weight: 700; color: var(--erp-side-muted); background: var(--erp-side-hover); padding: 1px 5px; border-radius: 5px; }
#erpNav a.erp-nl[aria-current="page"] .erp-k { color: #fff; background: rgba(255, 255, 255, .22); }
#erpNav .erp-n { min-width: 18px; height: 18px; border-radius: 9px; background: var(--erp-warn); color: #fff; font-size: 11px; font-weight: 800; display: inline-grid; place-items: center; padding: 0 5px; }
#erpNav .erp-grp { display: block; }
#erpNav .erp-sum { width: 100%; cursor: pointer; margin: 4px 0 0; padding: 8px; border-radius: 9px; font-weight: 700; display: flex; justify-content: space-between; align-items: center; gap: 8px; text-align: left; }
#erpNav .erp-sum:hover { background: var(--erp-side-hover); }
#erpNav .erp-sum .erp-c { font-size: 10.5px; color: var(--erp-side-muted); font-weight: 700; }
#erpNav .erp-sum .erp-c::after { content: " ▸"; font-size: 9px; }
#erpNav .erp-open .erp-sum .erp-c::after { content: " ▾"; }
#erpNav .erp-items { display: none; }
#erpNav .erp-open .erp-items { display: block; }
#erpNav .erp-items a.erp-nl { padding-left: 16px; font-weight: 500; }
#erpNav .erp-foot { margin-top: auto; padding: 10px 8px 0; border-top: 1px solid rgba(255, 255, 255, .12); font-size: 11.5px; color: var(--erp-side-muted); display: grid; gap: 3px; }
#erpNav .erp-foot a { display: block; }
#erpNav .erp-foot .erp-me { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---- "Viewing as" (admin only, 1.2.0): a selector at the bottom of the sidebar; while previewing, a block on top with Stop */
#erpNav .erp-viewas { display: grid; gap: 4px; margin-bottom: 8px; }
#erpNav .erp-viewas span { font-size: 10.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--erp-side-muted); }
#erpNav .erp-viewas select { font: inherit; font-size: 12.5px; width: 100%; padding: 6px 8px; border-radius: 8px; border: 0; background: rgba(255, 255, 255, .12); color: var(--erp-side-ink); }
#erpNav .erp-viewas select option { color: #1d1d1b; }
#erpNav .erp-preview { display: flex; align-items: center; gap: 8px; margin: -4px -4px 8px; padding: 8px 10px; border-radius: 9px; background: #ffb347; color: #1d1d1b; font-size: 12.5px; }
#erpNav .erp-preview b { font-weight: 800; }
#erpNav .erp-preview a { margin-left: auto; font-weight: 800; text-decoration: underline; }
/* ---- (old fixed bar, kept for the classes) ---- */
#erpNav .erp-view { position: fixed; left: var(--erp-side-w); right: 0; top: 0; z-index: 901; background: #1d1d1b; color: #fff; padding: 6px 14px; font-size: 12.5px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
#erpNav .erp-view .erp-tag { background: #ffb347; color: #1d1d1b; font-weight: 800; padding: 1px 7px; border-radius: 6px; font-size: 10.5px; letter-spacing: .05em; }
#erpNav .erp-view select { font: inherit; font-size: 12.5px; padding: 3px 8px; border-radius: 7px; border: 0; max-width: 60vw; }
#erpNav .erp-view .erp-off { margin-left: auto; color: #ffb347; font-weight: 700; }

/* ---- the slim top bar (phone) ---- */
#erpNav .erp-topbar { display: none; }
#erpNav .erp-sheetbg { position: fixed; inset: 0; z-index: 950; background: rgba(0, 0, 0, .38); }
#erpNav .erp-sheet { position: absolute !important; left: 0; right: 0; bottom: 0; height: 84vh; max-height: 84vh; overflow-y: auto; overscroll-behavior: contain; transition: transform .18s ease; background: var(--erp-side); color: var(--erp-side-ink); border-radius: 18px 18px 0 0; padding: 10px 12px calc(26px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 4px; }
#erpNav .erp-sheet .erp-grab { width: 38px; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, .3); margin: 0 auto 8px; flex: 0 0 auto; }
#erpNav .erp-sheet a.erp-nl { padding: 9px 8px; font-size: 14px; }
#erpNav .erp-sheet .erp-items a.erp-nl { padding-left: 16px; }
#erpNav .erp-sheet .erp-sum { padding: 10px 8px; font-size: 14px; }

@media (min-width: 901px) {
  html.erp-nav { padding-left: var(--erp-side-w); }
  html.erp-nav.erp-viewing { padding-top: 34px; }
  html.erp-nav.erp-viewing #erpNav .erp-side { top: 0; }
}
@media (max-width: 900px) {
  html.erp-nav { padding-top: var(--erp-top-h); }
  /* the apps' own sticky headers (header.top, header.sub, My Space, Events .bar) stick under our bar, not behind it */
  html.erp-nav header.top, html.erp-nav header.sub, html.erp-nav .space header, html.erp-nav .bar { top: var(--erp-top-h) !important; }
  #erpNav .erp-side { display: none; }
  #erpNav .erp-view { left: 0; position: fixed; top: var(--erp-top-h); font-size: 11.5px; padding: 4px 10px; }
  html.erp-nav.erp-viewing { padding-top: calc(var(--erp-top-h) + 30px); }
  #erpNav .erp-topbar { position: fixed; left: 0; right: 0; top: 0; height: var(--erp-top-h); z-index: 900; background: var(--erp-side); color: var(--erp-side-ink);
    display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; padding: 0 2px; }
  #erpNav .erp-topbar a, #erpNav .erp-topbar button { display: grid; place-items: center; height: 44px; font-size: 20px; }
  #erpNav .erp-topbar .erp-t { text-align: center; font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  #erpNav .erp-topbar .erp-t small { display: block; text-align: center; font-weight: 500; font-size: 11px; color: var(--erp-side-muted); line-height: 1.1; }
}
