/* ==========================================================================
   RiverSync — shell chrome (surface pills, portal switcher / launcher).
   Extracted from rs-shell.js injectAdminStyles()/injectShellChrome() so the
   React AppShell (and any static mock) gets identical chrome from CSS alone.
   The vanilla shell injects the same rules at runtime (id-guarded; harmless).
   ========================================================================== */

/* portal identity badges — five federated surfaces, one shell.
   Monotone: each badge lives entirely in its domain hue — tinted chip,
   hue border, solid-hue icon tile, hue text. Hues anchor in the logo's
   cyan/red plus the extended palette. .rs-portalbadge--sm for the top bar. */
.rs-portalbadge{display:inline-flex; align-items:center; gap:8px; padding:4px 10px 4px 4px; background:var(--surface-3); border:1px solid var(--border-strong); border-radius:var(--r-md); color:var(--fg2);}
.rs-portalbadge__ic{width:22px; height:22px; border-radius:var(--r-sm); display:flex; align-items:center; justify-content:center; color:inherit; background:transparent; flex:none;}
.rs-portalbadge__ic .rs-ic{width:15px; height:15px; stroke-width:1.7;}
.rs-portalbadge__t{display:flex; flex-direction:column; line-height:1.15;}
.rs-portalbadge__t b{font-size:11px; font-weight:700; letter-spacing:.05em; text-transform:uppercase; color:inherit;}
.rs-portalbadge__t span{font-size:10px; color:inherit; opacity:.72;}
.rs-portalbadge--admin{background:#EFECF6; border-color:#D6CCE9; color:#5F4F92;}
.rs-portalbadge--partners{background:#E4F4EF; border-color:#BFE4D9; color:#317C68;}
.rs-portalbadge--portal{background:#E2F3FB; border-color:#BCE4F4; color:#0B729E;}
.rs-portalbadge--account{background:#EEF2F5; border-color:#D2DAE1; color:#4A545D;}
.rs-portalbadge--pipeline{background:#FBF1DC; border-color:#EAD3A2; color:#8F6710;}
.rs-portalbadge--sm{padding:3px 8px 3px 3px; gap:6px;}
.rs-portalbadge--sm .rs-portalbadge__ic{width:18px; height:18px;}
.rs-portalbadge--sm .rs-portalbadge__t span{display:none;}
/* dark theme — same hues, deep-tinted chips (mirrors the hub/ops pill pattern) */
[data-theme="dark"] .rs-portalbadge{background:var(--surface-3); border-color:var(--border-strong); color:var(--fg2);}
[data-theme="dark"] .rs-portalbadge--admin{background:#231C36; border-color:#453868; color:#B3A4DC;}
[data-theme="dark"] .rs-portalbadge--partners{background:#10291F; border-color:#1F4D3C; color:#6FC3A6;}
[data-theme="dark"] .rs-portalbadge--portal{background:#0E2C3A; border-color:#1E4C63; color:#7FD0EE;}
[data-theme="dark"] .rs-portalbadge--account{background:#272E35; border-color:#3A434C; color:#BCC8D4;}
[data-theme="dark"] .rs-portalbadge--pipeline{background:#2E2410; border-color:#57451C; color:#E3B95C;}

/* surface pill — top-left of the header bar. Unmodified = Admin (purple). */
.rs-adminpill{font-size:10px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:#5F4F92;background:#EFECF6;border:1px solid #D6CCE9;padding:2px 7px;border-radius:var(--r-pill);margin-left:2px;}
[data-theme="dark"] .rs-adminpill{color:#B3A4DC;background:#231C36;border-color:#453868;}
.rs-accountpill{color:var(--fg2);background:var(--surface-3);border-color:var(--border);}
.rs-top__nav{display:flex;align-items:center;gap:6px;min-width:0;overflow:hidden;}
.rs-top__nav > .rs-adminpill{margin-left:0;margin-right:0;flex:none;}
.rs-top__nav > .rs-portalbadge{flex:none;}

/* hub pill — cyan-leaning to echo the "River" half of the logo */
.rs-hubpill{color:#0B86B8;background:#E2F3FB;border-color:#BCE4F4;}
[data-theme="dark"] .rs-hubpill{color:#7FD0EE;background:#0E2C3A;border-color:#1E4C63;}
/* operations pill — orange-gold (the staff NOC / Pipeline) */
.rs-opspill{color:#8F6710;background:#FBF1DC;border-color:#EAD3A2;}
[data-theme="dark"] .rs-opspill{color:#E3B95C;background:#2E2410;border-color:#57451C;}

/* view-as (impersonation) banner */
.rs-viewasbar{position:sticky;top:var(--topbar-h);z-index:16;display:flex;align-items:center;gap:12px;padding:9px 22px;color:#7a5b00;background:repeating-linear-gradient(45deg,#fff4d6 0 14px,#fbeec0 14px 28px);border-bottom:1px solid var(--warning-border);}
[data-theme="dark"] .rs-viewasbar{color:#e8c98a;background:repeating-linear-gradient(45deg,#241c0e 0 14px,#2e2413 14px 28px);}
.rs-viewasbar__ic{flex:none;width:30px;height:30px;border-radius:50%;display:flex;align-items:center;justify-content:center;background:rgba(122,91,0,.14);}
.rs-viewasbar__ic .rs-ic{width:17px;height:17px;}
.rs-viewasbar__body{flex:1 1 auto;min-width:0;font-size:12.5px;line-height:1.4;}
.rs-viewasbar__body b{font-weight:700;}

/* portal switcher — the WHOLE brand row is the product switcher */
.rs-switcher{position:relative;}
.rs-brandbtn{display:flex;align-items:center;gap:0;width:100%;height:100%;padding:0 16px 0 var(--nav-gutter);border:0;background:transparent;color:var(--fg2);cursor:pointer;font:inherit;}
.rs-switcher__grid{display:flex;align-items:center;justify-content:center;transition:color .12s;}
.rs-brandbtn .rs-ic{box-sizing:content-box;width:16px;height:16px;padding:8px;stroke-width:1.5;}
.rs-side__brand{padding:0;cursor:pointer;transition:background .12s;}
.rs-side__brand:hover,.rs-side__brand.is-open{background:var(--surface-2);}
.rs-side__brand.is-open .rs-switcher__grid{color:var(--accent);}
.rs-switcher__mark{display:none;width:24px;height:24px;}
.is-collapsed .rs-brandbtn{justify-content:center;padding:0;}
.is-collapsed .rs-switcher__grid{display:none;}
.is-collapsed .rs-switcher__mark{display:block;}

/* launcher menu — fixed so it escapes the sidebar overflow; flush to button */
.rs-pop.rs-switcher > .rs-launch{position:fixed;left:0;top:var(--topbar-h);right:auto;bottom:auto;width:var(--sidebar-w);padding:0;border-radius:0;z-index:2000;}
.rs-pop.rs-switcher.is-open > .rs-launch{opacity:1 !important;transform:none !important;pointer-events:auto !important;}
.rs-launch__row{display:grid;grid-template-columns:repeat(3,1fr);gap:0;padding:0;}
.rs-launchtile{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;width:auto;min-width:74px;height:74px;border-radius:0;text-decoration:none;color:var(--fg2);cursor:pointer;transition:background .1s,color .1s;}
.rs-launchtile:hover{background:var(--surface-2);color:var(--fg);}
.rs-launchtile.is-disabled{opacity:.45;cursor:default;pointer-events:none;}
.rs-launchtile__ic{display:flex;align-items:center;justify-content:center;color:var(--fg2);transition:color .1s;}
.rs-launchtile__ic .rs-ic{width:24px;height:24px;}
.rs-launchtile:hover .rs-launchtile__ic{color:var(--fg);}
.rs-launchtile.is-current{color:var(--accent);}
.rs-launchtile.is-current .rs-launchtile__ic{color:var(--accent);}
.rs-launchtile__lbl{font-size:11px;font-weight:600;line-height:1;}
