/* GUIDKO — système d'icônes premium (SVG stroké, cohérent, currentColor).
   Remplace les emoji dans la chrome (nav, rails, sections) pour un rendu propre.
   Usage : <GKIcon name="wallet" size={18}/>. Fallback : rien si nom inconnu. */

const GK_ICON_PATHS = {
  // Navigation / espaces
  overview:  '<path d="M4 13h7V4H4v9Zm9 7h7v-9h-7v9ZM4 20h7v-4H4v4Zm9-16v4h7V4h-7Z"/>',
  schedule:  '<rect x="4" y="5" width="16" height="16" rx="2"/><path d="M16 3v4M8 3v4M4 10h16"/>',
  students:  '<circle cx="9" cy="8" r="3"/><path d="M3 20a6 6 0 0 1 12 0M17 11a3 3 0 0 0 0-6M21 20a6 6 0 0 0-5-5.9"/>',
  user:      '<circle cx="12" cy="8" r="3.5"/><path d="M5.5 20a6.5 6.5 0 0 1 13 0"/>',
  instructor:'<path d="M12 3 3 7l9 4 9-4-9-4Z"/><path d="M7 9.5V14c0 1.7 2.2 3 5 3s5-1.3 5-3V9.5M20 8v5"/>',
  vehicles:  '<path d="M5 11l1.5-4.5A2 2 0 0 1 8.4 5h7.2a2 2 0 0 1 1.9 1.5L19 11M5 11h14v5H5v-5Z"/><circle cx="8" cy="16" r="1.5"/><circle cx="16" cy="16" r="1.5"/>',
  analytics: '<path d="M5 20V10M12 20V4M19 20v-7"/>',
  finance:   '<circle cx="12" cy="12" r="8.5"/><path d="M15 9.5a3.5 3.5 0 0 0-3-1.5c-2 0-3 1-3 2s1 1.6 3 2 3 1 3 2-1 2-3 2a3.5 3.5 0 0 1-3-1.5M12 6v1.5M12 16.5V18"/>',
  wallet:    '<rect x="3" y="6" width="18" height="13" rx="2.5"/><path d="M3 10h18M16.5 14.5h.01"/>',
  messages:  '<path d="M4 5h16v11H8l-4 3.5V5Z"/>',
  trust:     '<path d="M12 3l7 2.5V11c0 4.5-3 8-7 9.5-4-1.5-7-5-7-9.5V5.5L12 3Z"/><path d="M9 12l2 2 4-4"/>',
  pricing:   '<path d="M4 13 11 6h7v7l-7 7-7-7Z"/><circle cx="14.5" cy="9.5" r="1.3"/>',
  security:  '<rect x="5" y="10" width="14" height="10" rx="2"/><path d="M8 10V7a4 4 0 0 1 8 0v3M12 14v2.5"/>',
  contracts: '<path d="M6 3h9l4 4v14H6V3Z"/><path d="M14 3v5h5M9 13h6M9 17h6"/>',
  referral:  '<path d="M12 8v13M5 8h14v3H5V8Z"/><path d="M12 8S10.5 4 8.5 4 5.5 6 7 7.5C8 8.5 12 8 12 8ZM12 8s1.5-4 3.5-4S18.5 6 17 7.5C16 8.5 12 8 12 8Z"/>',
  region:    '<circle cx="12" cy="12" r="8.5"/><path d="M3.5 12h17M12 3.5c2.5 2.5 2.5 14 0 17M12 3.5c-2.5 2.5-2.5 14 0 17"/>',
  settings:  '<circle cx="12" cy="12" r="3"/><path d="M12 3v2.5M12 18.5V21M21 12h-2.5M5.5 12H3M18.4 5.6l-1.8 1.8M7.4 16.6l-1.8 1.8M18.4 18.4l-1.8-1.8M7.4 7.4 5.6 5.6"/>',
  gps:       '<circle cx="12" cy="11" r="3"/><path d="M12 21c4-4 7-7.2 7-10a7 7 0 1 0-14 0c0 2.8 3 6 7 10Z"/>',
  publish:   '<path d="M12 20V5M5 12l7-7 7 7"/>',
  search:    '<circle cx="11" cy="11" r="6.5"/><path d="m20 20-3.5-3.5"/>',
  // Apps
  pro:       '<path d="M4 18h16M5 8l3.5 3L12 6l3.5 5L19 8l-1.5 8h-11L4 8Z"/>',
  eleve:     '<path d="M12 4 3 19h18L12 4Z"/>',
  auto:      '<path d="M7 7h11l-2.5-2.5M17 17H6l2.5 2.5"/><path d="M18 7v3M6 17v-3"/>',
  covoit:    '<path d="M7 4v16l-3-3M7 4l3 3M17 20V4l3 3M17 20l-3-3"/>',
  livraison: '<path d="M12 3 3 7.5V16l9 4.5 9-4.5V7.5L12 3Z"/><path d="M3 7.5 12 12l9-4.5M12 12v8.5"/>',
  b2b:       '<path d="M3 21V9l6-3v3l6-3v15M3 21h18M15 21V10l4-2v13"/>',
  drive:     '<circle cx="12" cy="11" r="2.5"/><path d="M12 21c4-4 7-7.2 7-10a7 7 0 1 0-14 0c0 2.8 3 6 7 10Z"/>',
  // Settings sections
  profil:    '<circle cx="12" cy="8" r="3.5"/><path d="M5.5 20a6.5 6.5 0 0 1 13 0"/>',
  notif:     '<path d="M6 9a6 6 0 0 1 12 0c0 5 2 6 2 6H4s2-1 2-6ZM10 19a2 2 0 0 0 4 0"/>',
  privacy:   '<path d="M12 3l7 2.5V11c0 4.5-3 8-7 9.5-4-1.5-7-5-7-9.5V5.5L12 3Z"/>',
  prefs:     '<circle cx="12" cy="12" r="8.5"/><path d="M3.5 12h17M12 3.5c2.5 2.5 2.5 14 0 17M12 3.5c-2.5 2.5-2.5 14 0 17"/>',
  linked:    '<path d="M9 12h6M10 8H8a4 4 0 0 0 0 8h2M14 8h2a4 4 0 0 1 0 8h-2"/>',
  metier:    '<path d="M4 18h16M5 8l3.5 3L12 6l3.5 5L19 8l-1.5 8h-11L4 8Z"/>',
  star:      '<path d="M12 4l2.4 5 5.6.8-4 4 1 5.6L12 16.8 6.9 19.4l1-5.6-4-4 5.6-.8L12 4Z"/>',
  target:    '<circle cx="12" cy="12" r="8"/><circle cx="12" cy="12" r="4"/><circle cx="12" cy="12" r=".5"/>',
  trendup:   '<path d="M4 16l5-5 4 4 7-7M16 8h4v4"/>',
  trenddown: '<path d="M4 8l5 5 4-4 7 7M16 16h4v-4"/>',
  alert:     '<path d="M12 8v5M12 16.5v.01"/><circle cx="12" cy="12" r="9"/>',
  flame:     '<path d="M12 3s5 4 5 9a5 5 0 0 1-10 0c0-1.5.6-2.8 1.4-3.8C9 10 9 12 10 12c1.5 0 1-3.5 2-9Z"/>',
  clipboard: '<rect x="6" y="4" width="12" height="17" rx="2"/><path d="M9 4a2 2 0 0 1 2-1.5h2A2 2 0 0 1 15 4M9 11h6M9 15h4"/>',
  edit:      '<path d="M5 19h3l9.5-9.5a2 2 0 0 0-3-3L5 16v3Z"/><path d="M14 6.5l3 3"/>',
  phone:     '<path d="M6 4h3l1.5 4-2 1.5a10 10 0 0 0 5 5l1.5-2 4 1.5V18a2 2 0 0 1-2 2A15 15 0 0 1 4 6a2 2 0 0 1 2-2Z"/>',
  heart:     '<path d="M12 20s-7-4.5-7-9.5A3.5 3.5 0 0 1 12 7a3.5 3.5 0 0 1 7 3.5C19 15.5 12 20 12 20Z"/>',
  play:      '<path d="M8 5.5v13l11-6.5-11-6.5Z"/>',
  plus:      '<path d="M12 5v14M5 12h14"/>',
  clock:     '<circle cx="12" cy="12" r="8.5"/><path d="M12 7.5V12l3 2"/>',
  location:  '<path d="M12 21c4-4 7-7.2 7-10a7 7 0 1 0-14 0c0 2.8 3 6 7 10Z"/><circle cx="12" cy="11" r="2.5"/>',
  shield:    '<path d="M12 3l7 2.5V11c0 4.5-3 8-7 9.5-4-1.5-7-5-7-9.5V5.5L12 3Z"/>',
  bolt:      '<path d="M13 3 5 13h5l-1 8 8-11h-5l1-7Z"/>',
  fuel:      '<path d="M5 21V5a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v16M4 21h12M15 9h2.5a2 2 0 0 1 2 2v5a1.5 1.5 0 0 0 3 0V8l-3-3"/>',
  check:     '<path d="M5 12.5l4.5 4.5L19 7"/>',
};

function GKIcon({ name, size = 18, stroke = 1.7, style }) {
  const d = GK_ICON_PATHS[name];
  if (!d) return null;
  return (
    <svg width={size} height={size} viewBox="0 0 24 24" fill="none" stroke="currentColor"
      strokeWidth={stroke} strokeLinecap="round" strokeLinejoin="round"
      style={{ display: "block", flexShrink: 0, ...style }}
      dangerouslySetInnerHTML={{ __html: d }}/>
  );
}
function hasGKIcon(name) { return !!GK_ICON_PATHS[name]; }

Object.assign(window, { GKIcon, hasGKIcon, GK_ICON_PATHS });