// Per-route accent colors. Each app section takes the same hue as its sidebar
// icon, applied by scoping the `--accent` CSS variable so every existing
// accent-styled element (eyebrows, badges, buttons, active states) recolors to
// match the page. Values are "R G B" triplets to match the CSS var convention.

export const PAGE_ACCENTS: Record<string, string> = {
  "/dashboard": "96 165 250", // blue
  "/agents": "192 132 252", // purple
  "/workflows": "56 189 248", // sky
  "/knowledge": "52 211 153", // emerald
  "/connectors": "245 165 36", // amber
  "/runs": "34 211 238", // cyan
  "/approvals": "251 113 133", // rose
  "/audit": "45 212 191", // teal
  "/admin": "167 139 250", // violet
};

// The brand default (Ink & Amber) for any route without its own accent.
export const DEFAULT_ACCENT = "245 165 36";

export function accentForPath(pathname: string): string {
  const key = Object.keys(PAGE_ACCENTS).find((k) => pathname.startsWith(k));
  return key ? PAGE_ACCENTS[key] : DEFAULT_ACCENT;
}

export function accentRgb(pathname: string): string {
  return `rgb(${accentForPath(pathname)})`;
}
