/* Immobase App — bibliothèque d'icônes (stroke, 1.7) */
function Icon({ d, size = 20, fill, stroke = 'currentColor', sw = 1.7, children, vb = 24, style }) {
  return (
    <svg width={size} height={size} viewBox={`0 0 ${vb} ${vb}`} fill={fill || 'none'} stroke={stroke}
      strokeWidth={sw} strokeLinecap="round" strokeLinejoin="round" style={style}>
      {d ? <path d={d} /> : children}
    </svg>
  );
}

const IconHome = (p) => <Icon {...p} d="M3 11 12 4l9 7v8.5a1 1 0 0 1-1 1h-4.5V14h-7v6.5H4a1 1 0 0 1-1-1V11Z" />;
const IconGrid = (p) => <Icon {...p}>{<><rect x="3.5" y="3.5" width="7" height="7" rx="2"/><rect x="13.5" y="3.5" width="7" height="7" rx="2"/><rect x="3.5" y="13.5" width="7" height="7" rx="2"/><rect x="13.5" y="13.5" width="7" height="7" rx="2"/></>}</Icon>;
const IconLink = (p) => <Icon {...p}>{<><path d="M10 14 14 10"/><path d="M11 7.5l1.5-1.5a3.5 3.5 0 0 1 5 5L16 12.5"/><path d="M13 16.5 11.5 18a3.5 3.5 0 0 1-5-5L8 11.5"/></>}</Icon>;
const IconDoc = (p) => <Icon {...p}>{<><rect x="5" y="3" width="14" height="18" rx="2.5"/><path d="M9 8h6M9 12h6M9 16h4"/></>}</Icon>;
const IconMail = (p) => <Icon {...p}>{<><rect x="3" y="5.5" width="18" height="13" rx="2.5"/><path d="m4 7 8 6 8-6"/></>}</Icon>;
const IconCalc = (p) => <Icon {...p}>{<><rect x="5" y="3" width="14" height="18" rx="2.5"/><path d="M8 7h8"/><circle cx="9" cy="12" r=".9" fill="currentColor" stroke="none"/><circle cx="12" cy="12" r=".9" fill="currentColor" stroke="none"/><circle cx="15" cy="12" r=".9" fill="currentColor" stroke="none"/><circle cx="9" cy="16" r=".9" fill="currentColor" stroke="none"/><circle cx="12" cy="16" r=".9" fill="currentColor" stroke="none"/><circle cx="15" cy="16" r=".9" fill="currentColor" stroke="none"/></>}</Icon>;
const IconCompare = (p) => <Icon {...p}>{<><rect x="3.5" y="4.5" width="7.5" height="15" rx="2"/><rect x="13" y="4.5" width="7.5" height="15" rx="2"/></>}</Icon>;
const IconPlus = (p) => <Icon {...p} d="M12 5v14M5 12h14" />;
const IconCheck = (p) => <Icon {...p} d="M4 12 9.5 17.5 20 6.5" />;
const IconX = (p) => <Icon {...p} d="M6 6l12 12M18 6 6 18" />;
const IconSearch = (p) => <Icon {...p}>{<><circle cx="10.5" cy="10.5" r="6.5"/><path d="M19 19l-4-4"/></>}</Icon>;
const IconMenu = (p) => <Icon {...p} d="M4 7h16M4 12h16M4 17h16" />;
const IconHeart = (p) => <Icon {...p} d="M12 20S3.5 14.5 3.5 8.8A4.3 4.3 0 0 1 12 6.2a4.3 4.3 0 0 1 8.5 2.6C20.5 14.5 12 20 12 20Z" />;
const IconCopy = (p) => <Icon {...p}>{<><rect x="8" y="8" width="12" height="12" rx="2.5"/><path d="M4 16V5.5A1.5 1.5 0 0 1 5.5 4H15"/></>}</Icon>;
const IconPin = (p) => <Icon {...p}>{<><path d="M12 21s7-5.5 7-11a7 7 0 1 0-14 0c0 5.5 7 11 7 11Z"/><circle cx="12" cy="10" r="2.6"/></>}</Icon>;
const IconPhone = (p) => <Icon {...p} d="M5 4h3l1.5 4-2 1.5a11 11 0 0 0 5 5l1.5-2 4 1.5V19a2 2 0 0 1-2 2A16 16 0 0 1 4 6a2 2 0 0 1 1-2Z" />;
const IconCal = (p) => <Icon {...p}>{<><rect x="4" y="5" width="16" height="16" rx="2.5"/><path d="M4 9h16M8 3v4M16 3v4"/></>}</Icon>;
const IconUser = (p) => <Icon {...p}>{<><circle cx="12" cy="8" r="4"/><path d="M4.5 20a7.5 7.5 0 0 1 15 0"/></>}</Icon>;
const IconNote = (p) => <Icon {...p}>{<><path d="M5 4h14v11l-5 5H5V4Z"/><path d="M14 20v-5h5M9 9h6M9 13h3"/></>}</Icon>;
const IconTrash = (p) => <Icon {...p}>{<><path d="M5 7h14M10 7V5h4v2M6 7l1 13h10l1-13"/></>}</Icon>;
const IconEdit = (p) => <Icon {...p} d="M5 19h2.5L18 8.5a1.8 1.8 0 0 0-2.5-2.5L5 16.5V19ZM14 7l3 3" />;
const IconArrow = (p) => <Icon {...p} d="M5 12h14M13 6l6 6-6 6" />;
const IconGlobe = (p) => <Icon {...p}>{<><circle cx="12" cy="12" r="9"/><path d="M3 12h18M12 3c2.5 2.4 4 5.6 4 9s-1.5 6.6-4 9c-2.5-2.4-4-5.6-4-9s1.5-6.6 4-9Z"/></>}</Icon>;
const IconSpark = (p) => <Icon {...p} d="M12 3l2 6 6 2-6 2-2 6-2-6-6-2 6-2 2-6Z" />;
const IconExternal = (p) => <Icon {...p}>{<><path d="M14 5h5v5M19 5l-8 8"/><path d="M19 14v4a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V7a2 2 0 0 1 2-2h4"/></>}</Icon>;
const IconChevron = (p) => <Icon {...p} d="M9 6l6 6-6 6" />;
const IconCog = (p) => <Icon {...p}>{<><circle cx="12" cy="12" r="3"/><path d="M12 2v3M12 19v3M4.2 4.2l2.1 2.1M17.7 17.7l2.1 2.1M2 12h3M19 12h3M4.2 19.8l2.1-2.1M17.7 6.3l2.1-2.1"/></>}</Icon>;
const IconLock = (p) => <Icon {...p}>{<><rect x="5" y="11" width="14" height="10" rx="2.5"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></>}</Icon>;

Object.assign(window, {
  Icon, IconHome, IconGrid, IconLink, IconDoc, IconMail, IconCalc, IconCompare,
  IconPlus, IconCheck, IconX, IconSearch, IconMenu, IconHeart, IconCopy,
  IconPin, IconPhone, IconCal, IconUser, IconNote, IconTrash, IconEdit, IconArrow,
  IconGlobe, IconSpark, IconExternal, IconChevron, IconCog, IconLock,
});
