// icons.jsx — lightweight stroke icons (no external lib)
const Icon = ({ name, size = 18, stroke = 1.6, ...rest }) => {
  const s = size;
  const common = {
    width: s, height: s, viewBox: "0 0 24 24",
    fill: "none", stroke: "currentColor", strokeWidth: stroke,
    strokeLinecap: "round", strokeLinejoin: "round",
    ...rest,
  };
  switch (name) {
    case "dashboard": return (<svg {...common}><rect x="3" y="3" width="7" height="9" rx="1.5"/><rect x="14" y="3" width="7" height="5" rx="1.5"/><rect x="14" y="12" width="7" height="9" rx="1.5"/><rect x="3" y="16" width="7" height="5" rx="1.5"/></svg>);
    case "in": return (<svg {...common}><path d="M12 4v12"/><path d="M7 11l5 5 5-5"/><path d="M4 20h16"/></svg>);
    case "out": return (<svg {...common}><path d="M12 20V8"/><path d="M7 13l5-5 5 5"/><path d="M4 4h16"/></svg>);
    case "items": return (<svg {...common}><path d="M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z"/><path d="m3.3 7 8.7 5 8.7-5"/><path d="M12 22V12"/></svg>);
    case "location": return (<svg {...common}><path d="M12 21s-7-6.5-7-12a7 7 0 1 1 14 0c0 5.5-7 12-7 12Z"/><circle cx="12" cy="9" r="2.5"/></svg>);
    case "reports": return (<svg {...common}><path d="M4 4v16h16"/><path d="M8 16V10"/><path d="M12 16V6"/><path d="M16 16v-4"/></svg>);
    case "settings": return (<svg {...common}><circle cx="12" cy="12" r="3"/><path d="M19.4 15a1.7 1.7 0 0 0 .34 1.87l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06a1.7 1.7 0 0 0-1.87-.34 1.7 1.7 0 0 0-1.04 1.57V21a2 2 0 1 1-4 0v-.07A1.7 1.7 0 0 0 9 19.4a1.7 1.7 0 0 0-1.87.34l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06A1.7 1.7 0 0 0 4.6 15 1.7 1.7 0 0 0 3 13.96H3a2 2 0 1 1 0-4h.07A1.7 1.7 0 0 0 4.6 9a1.7 1.7 0 0 0-.34-1.87l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06A1.7 1.7 0 0 0 9 4.6H9a1.7 1.7 0 0 0 1-1.57V3a2 2 0 1 1 4 0v.07a1.7 1.7 0 0 0 1 1.57 1.7 1.7 0 0 0 1.87-.34l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06a1.7 1.7 0 0 0-.34 1.87V9a1.7 1.7 0 0 0 1.57 1H21a2 2 0 1 1 0 4h-.07a1.7 1.7 0 0 0-1.53 1Z"/></svg>);
    case "search": return (<svg {...common}><circle cx="11" cy="11" r="7"/><path d="m20 20-3.5-3.5"/></svg>);
    case "bell": return (<svg {...common}><path d="M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9"/><path d="M10 21a2 2 0 0 0 4 0"/></svg>);
    case "plus": return (<svg {...common}><path d="M12 5v14"/><path d="M5 12h14"/></svg>);
    case "minus": return (<svg {...common}><path d="M5 12h14"/></svg>);
    case "x": return (<svg {...common}><path d="M18 6 6 18"/><path d="m6 6 12 12"/></svg>);
    case "check": return (<svg {...common}><path d="M20 6 9 17l-5-5"/></svg>);
    case "arrow-right": return (<svg {...common}><path d="M5 12h14"/><path d="m12 5 7 7-7 7"/></svg>);
    case "arrow-down": return (<svg {...common}><path d="M12 5v14"/><path d="m19 12-7 7-7-7"/></svg>);
    case "arrow-up": return (<svg {...common}><path d="M12 19V5"/><path d="m5 12 7-7 7 7"/></svg>);
    case "filter": return (<svg {...common}><path d="M4 4h16l-6 8v6l-4 2v-8L4 4Z"/></svg>);
    case "download": return (<svg {...common}><path d="M12 3v12"/><path d="m7 10 5 5 5-5"/><path d="M5 21h14"/></svg>);
    case "warehouse": return (<svg {...common}><path d="M3 21V9l9-5 9 5v12"/><path d="M7 21v-7h10v7"/><path d="M10 14h4"/><path d="M10 18h4"/></svg>);
    case "store": return (<svg {...common}><path d="M3 9 5 4h14l2 5"/><path d="M3 9v11h18V9"/><path d="M3 9h18"/><path d="M9 20v-6h6v6"/></svg>);
    case "qc": return (<svg {...common}><path d="M9 12 11 14l4-4"/><path d="M12 2 4 5v6c0 5 4 9 8 11 4-2 8-6 8-11V5l-8-3Z"/></svg>);
    case "barcode": return (<svg {...common}><path d="M4 6v12"/><path d="M7 6v12"/><path d="M10 6v12"/><path d="M14 6v12"/><path d="M17 6v12"/><path d="M20 6v12"/></svg>);
    case "more": return (<svg {...common}><circle cx="12" cy="5" r="1"/><circle cx="12" cy="12" r="1"/><circle cx="12" cy="19" r="1"/></svg>);
    case "edit": return (<svg {...common}><path d="M17 3a2.85 2.85 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3Z"/></svg>);
    case "trash": return (<svg {...common}><path d="M3 6h18"/><path d="M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"/><path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6"/></svg>);
    case "history": return (<svg {...common}><path d="M3 12a9 9 0 1 0 3-6.7"/><path d="M3 4v5h5"/><path d="M12 7v5l3 2"/></svg>);
    case "calendar": return (<svg {...common}><rect x="3" y="4" width="18" height="18" rx="2"/><path d="M3 10h18"/><path d="M8 2v4"/><path d="M16 2v4"/></svg>);
    case "transfer": return (<svg {...common}><path d="M3 7h13"/><path d="m12 3 4 4-4 4"/><path d="M21 17H8"/><path d="m12 21-4-4 4-4"/></svg>);
    case "trend-up": return (<svg {...common}><path d="m22 7-8.5 8.5L9 11l-7 7"/><path d="M16 7h6v6"/></svg>);
    case "trend-down": return (<svg {...common}><path d="m22 17-8.5-8.5L9 13l-7-7"/><path d="M16 17h6v-6"/></svg>);
    case "alert": return (<svg {...common}><path d="M12 9v4"/><path d="M12 17h.01"/><path d="M10.3 3.86 1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.41 0Z"/></svg>);
    case "logout": return (<svg {...common}><path d="M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"/><path d="m16 17 5-5-5-5"/><path d="M21 12H9"/></svg>);
    case "package": return (<svg {...common}><path d="M16.5 9.4 7.5 4.2"/><path d="M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z"/><path d="m3.3 7 8.7 5 8.7-5"/><path d="M12 22V12"/></svg>);
    case "qr": return (<svg {...common}><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"/><path d="M14 14h3v3h-3z"/><path d="M20 14v3"/><path d="M14 20h3"/><path d="M20 20v1"/></svg>);
    default: return null;
  }
};

window.Icon = Icon;
