// Hand-rolled line icons. 1.5 stroke, 24-grid. Match Lucide vibe but original.
const Ic = ({ d, size = 16, sw = 1.5, fill, ...rest }) => (
  <svg viewBox="0 0 24 24" width={size} height={size} fill={fill || 'none'} stroke="currentColor" strokeWidth={sw} strokeLinecap="round" strokeLinejoin="round" {...rest}>
    {typeof d === 'string' ? <path d={d} /> : d}
  </svg>
);

const Icon = {
  Dashboard: (p) => <Ic {...p} d={<>
    <rect x="3" y="3" width="7" height="9" /><rect x="14" y="3" width="7" height="5" />
    <rect x="14" y="12" width="7" height="9" /><rect x="3" y="16" width="7" height="5" />
  </>} />,
  Grid: (p) => <Ic {...p} d={<>
    <rect x="3" y="3" width="7" height="7" /><rect x="14" y="3" width="7" height="7" />
    <rect x="3" y="14" width="7" height="7" /><rect x="14" y="14" width="7" height="7" />
  </>} />,
  Trades: (p) => <Ic {...p} d="M3 7h13l-3-3M21 17H8l3 3" />,
  Config: (p) => <Ic {...p} d={<>
    <path d="M4 6h12M4 12h16M4 18h8"/><circle cx="18" cy="6" r="2"/><circle cx="14" cy="18" r="2"/>
  </>} />,
  Control: (p) => <Ic {...p} d={<>
    <circle cx="12" cy="12" r="9"/><path d="M12 7v5l3 2"/>
  </>} />,
  Logs: (p) => <Ic {...p} d={<>
    <path d="M5 4h11l3 3v13H5z"/><path d="M8 10h8M8 14h8M8 18h5"/>
  </>} />,
  Replay: (p) => <Ic {...p} d={<>
    <path d="M3 12a9 9 0 1 0 3-6.7"/><path d="M3 4v5h5"/>
  </>} />,
  Bell: (p) => <Ic {...p} d={<>
    <path d="M6 8a6 6 0 1 1 12 0c0 5 2 6 2 7H4c0-1 2-2 2-7z"/><path d="M10 19a2 2 0 0 0 4 0"/>
  </>} />,
  ChevronDown: (p) => <Ic {...p} d="M6 9l6 6 6-6" />,
  ChevronRight: (p) => <Ic {...p} d="M9 6l6 6-6 6" />,
  ChevronUp: (p) => <Ic {...p} d="M6 15l6-6 6 6" />,
  ArrowRight: (p) => <Ic {...p} d="M5 12h14M13 6l6 6-6 6" />,
  Copy: (p) => <Ic {...p} d={<>
    <rect x="8" y="8" width="12" height="12" rx="1"/><path d="M16 8V5a1 1 0 0 0-1-1H5a1 1 0 0 0-1 1v10a1 1 0 0 0 1 1h3"/>
  </>} />,
  Play: (p) => <Ic {...p} d="M6 4l14 8-14 8z" />,
  Pause: (p) => <Ic {...p} d={<><rect x="6" y="4" width="4" height="16"/><rect x="14" y="4" width="4" height="16"/></>} />,
  Step: (p) => <Ic {...p} d="M5 4l8 8-8 8M14 4v16" />,
  StepBack: (p) => <Ic {...p} d="M19 4l-8 8 8 8M10 4v16" />,
  Stop: (p) => <Ic {...p} d={<><rect x="5" y="5" width="14" height="14"/></>} />,
  Search: (p) => <Ic {...p} d={<><circle cx="11" cy="11" r="6"/><path d="M20 20l-4-4"/></>} />,
  X: (p) => <Ic {...p} d="M6 6l12 12M6 18L18 6" />,
  Check: (p) => <Ic {...p} d="M5 12l5 5 9-11" />,
  Halt: (p) => <Ic {...p} d={<>
    <circle cx="12" cy="12" r="9"/><path d="M8 8l8 8M16 8l-8 8"/>
  </>} />,
  Power: (p) => <Ic {...p} d={<><path d="M12 4v8"/><path d="M5.5 8a8 8 0 1 0 13 0"/></>} />,
  Reload: (p) => <Ic {...p} d={<><path d="M21 12a9 9 0 1 1-3-6.7"/><path d="M21 4v5h-5"/></>} />,
  AlertTri: (p) => <Ic {...p} d={<><path d="M12 3l10 18H2z"/><path d="M12 10v5"/><circle cx="12" cy="18" r="0.6" fill="currentColor"/></>} />,
  Info: (p) => <Ic {...p} d={<><circle cx="12" cy="12" r="9"/><path d="M12 11v6"/><circle cx="12" cy="8" r="0.7" fill="currentColor"/></>} />,
  Logout: (p) => <Ic {...p} d={<><path d="M14 4h5v16h-5"/><path d="M10 8l-4 4 4 4M6 12h11"/></>} />,
  User: (p) => <Ic {...p} d={<><circle cx="12" cy="8" r="4"/><path d="M4 21c1.5-4 4.5-6 8-6s6.5 2 8 6"/></>} />,
  Filter: (p) => <Ic {...p} d="M3 5h18l-7 9v6l-4-2v-4z" />,
  Maximize: (p) => <Ic {...p} d="M4 9V4h5M20 9V4h-5M4 15v5h5M20 15v5h-5" />,
  Dot: (p) => <Ic {...p} d={<><circle cx="12" cy="12" r="3" fill="currentColor"/></>} />,
  Layers: (p) => <Ic {...p} d="M12 3l9 5-9 5-9-5zM3 13l9 5 9-5M3 18l9 5 9-5" />,
  Hash: (p) => <Ic {...p} d="M5 9h14M5 15h14M10 4l-2 16M16 4l-2 16" />,
};

window.Icon = Icon;
