// Lightweight icon set — 16px stroke icons, original geometry
const Icon = ({ d, size = 16, fill = false, stroke = 'currentColor', ...rest }) => (
  <svg width={size} height={size} viewBox="0 0 16 16" fill={fill ? 'currentColor' : 'none'}
       stroke={fill ? 'none' : stroke} strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round" {...rest}>
    {typeof d === 'string' ? <path d={d} /> : d}
  </svg>
);

const Icons = {
  // Discovery — magnifier + spark
  Discovery: (p) => <Icon {...p} d={<>
    <circle cx="7" cy="7" r="4" />
    <path d="M10 10l3 3" />
    <path d="M7 5v4M5 7h4" strokeWidth="1" opacity="0.6"/>
  </>}/>,
  // Agent Jobs — concentric task badge
  Jobs: (p) => <Icon {...p} d={<>
    <rect x="2" y="3" width="12" height="10" rx="2" />
    <path d="M5 6.5h6M5 9h4" />
  </>}/>,
  // Integrations — connected nodes
  Integrations: (p) => <Icon {...p} d={<>
    <circle cx="3.5" cy="8" r="1.6"/>
    <circle cx="12.5" cy="4" r="1.6"/>
    <circle cx="12.5" cy="12" r="1.6"/>
    <path d="M5 7.2l6-2.6M5 8.8l6 2.6"/>
  </>}/>,
  // Data — stacked cylinder
  Data: (p) => <Icon {...p} d={<>
    <ellipse cx="8" cy="3.5" rx="5" ry="1.5"/>
    <path d="M3 3.5v5c0 .8 2.2 1.5 5 1.5s5-.7 5-1.5v-5"/>
    <path d="M3 8.5v4c0 .8 2.2 1.5 5 1.5s5-.7 5-1.5v-4"/>
  </>}/>,
  // Business Rules — branching logic
  Rules: (p) => <Icon {...p} d={<>
    <rect x="6" y="2" width="4" height="3" rx="0.5"/>
    <rect x="2" y="11" width="4" height="3" rx="0.5"/>
    <rect x="10" y="11" width="4" height="3" rx="0.5"/>
    <path d="M8 5v2M8 7H4v4M8 7h4v4"/>
  </>}/>,
  Inbox: (p) => <Icon {...p} d={<>
    <path d="M2 9l1.5-5h9L14 9"/>
    <path d="M2 9v3.5c0 .3.2.5.5.5h11c.3 0 .5-.2.5-.5V9"/>
    <path d="M2 9h3l1 1.5h4L11 9h3"/>
  </>}/>,
  Chevron: (p) => <Icon {...p} d="M6 4l4 4-4 4"/>,
  ChevDown: (p) => <Icon {...p} d="M4 6l4 4 4-4"/>,
  ChevUp: (p) => <Icon {...p} d="M4 10l4-4 4 4"/>,
  ChevLeft: (p) => <Icon {...p} d="M10 4l-4 4 4 4"/>,
  Slash: (p) => <Icon {...p} d="M11 3L5 13" stroke="currentColor"/>,
  Check: (p) => <Icon {...p} d="M3 8.5l3 3 7-7"/>,
  Plus: (p) => <Icon {...p} d="M8 3v10M3 8h10"/>,
  Cog: (p) => <Icon {...p} d={<>
    <circle cx="8" cy="8" r="2"/>
    <path d="M8 1.5v2M8 12.5v2M14.5 8h-2M3.5 8h-2M12.6 3.4l-1.4 1.4M4.8 11.2l-1.4 1.4M12.6 12.6l-1.4-1.4M4.8 4.8L3.4 3.4"/>
  </>}/>,
  Search: (p) => <Icon {...p} d={<>
    <circle cx="7" cy="7" r="4.5"/>
    <path d="M10.5 10.5L13 13"/>
  </>}/>,
  Filter: (p) => <Icon {...p} d={<>
    <path d="M2 4h12M4 8h8M6 12h4"/>
  </>}/>,
  Sidebar: (p) => <Icon {...p} d={<>
    <rect x="2" y="3" width="12" height="10" rx="1.5"/>
    <path d="M6 3v10"/>
  </>}/>,
  Logout: (p) => <Icon {...p} d={<>
    <path d="M9 3H4c-.55 0-1 .45-1 1v8c0 .55.45 1 1 1h5"/>
    <path d="M11 5l3 3-3 3M7 8h7"/>
  </>}/>,
  User: (p) => <Icon {...p} d={<>
    <circle cx="8" cy="6" r="2.5"/>
    <path d="M3 13c.5-2.5 2.5-4 5-4s4.5 1.5 5 4"/>
  </>}/>,
  Theme: (p) => <Icon {...p} d={<>
    <path d="M8 2v12M2 8h12"/>
    <circle cx="8" cy="8" r="6"/>
  </>}/>,
  Help: (p) => <Icon {...p} d={<>
    <circle cx="8" cy="8" r="6"/>
    <path d="M6.3 6.3a1.7 1.7 0 0 1 3.4 0c0 1-1.7 1.4-1.7 2.5"/>
    <circle cx="8" cy="11.5" r="0.5" fill="currentColor"/>
  </>}/>,
  Building: (p) => <Icon {...p} d={<>
    <rect x="3" y="2" width="10" height="12" rx="1"/>
    <path d="M6 5h1M9 5h1M6 8h1M9 8h1M6 11h4"/>
  </>}/>,
};

window.Icons = Icons;
