// Theme tokens for DashM ADV — warm professional law-office palette
// Exports T (dark + light) and small style helpers to window.

const T = {
  dark: {
    bg:        '#16100b',
    surface:   '#1f1610',
    elevated:  '#2a1f17',
    raised:    '#352719',
    border:    '#3a2a1f',
    borderSoft:'#2c2018',
    text:      '#f0e4d2',
    textDim:   '#cdb699',
    subtext:   '#a59076',
    muted:     '#7a6651',
    accent:    '#c8956d',    // cognac
    accent2:   '#d4a574',    // sand
    accentDeep:'#8b5a3c',
    positive:  '#7fa97f',
    danger:    '#c47b6c',
    warn:      '#d4a574',
    chipBg:    'rgba(200,149,109,0.13)',
    chipText:  '#d4a574',
    shadow:    '0 1px 2px rgba(0,0,0,0.4)',
  },
  light: {
    bg:        '#faf4ea',
    surface:   '#fffaf2',
    elevated:  '#ffffff',
    raised:    '#fff7ea',
    border:    '#e6d5bd',
    borderSoft:'#f0e2cc',
    text:      '#2a1d12',
    textDim:   '#4a3826',
    subtext:   '#6e5a44',
    muted:     '#a08c70',
    accent:    '#8b4513',
    accent2:   '#a86c3a',
    accentDeep:'#5c2e0a',
    positive:  '#3f7c4c',
    danger:    '#a14a3a',
    warn:      '#b08055',
    chipBg:    'rgba(139,69,19,0.10)',
    chipText:  '#8b4513',
    shadow:    '0 1px 2px rgba(60,30,10,0.06)',
  },
};

// Small Icon registry — minimal stroke SVGs (no decorative complexity)
const Icon = ({ name, size = 16, color = 'currentColor', stroke = 1.6 }) => {
  const p = { width: size, height: size, viewBox: '0 0 24 24', fill: 'none',
    stroke: color, strokeWidth: stroke, strokeLinecap: 'round', strokeLinejoin: 'round' };
  switch (name) {
    case 'home':       return <svg {...p}><path d="M3 11l9-7 9 7v9a2 2 0 0 1-2 2h-4v-7h-6v7H5a2 2 0 0 1-2-2z"/></svg>;
    case 'gavel':      return <svg {...p}><path d="M14 3l7 7-3 3-7-7zM10 7l7 7-7 7-7-7z"/><path d="M3 21h10"/></svg>;
    case 'briefcase': return <svg {...p}><rect x="3" y="7" width="18" height="13" rx="2"/><path d="M9 7V5a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v2"/><path d="M3 13h18"/></svg>;
    case 'users':      return <svg {...p}><circle cx="9" cy="8" r="3"/><path d="M3 21v-1a4 4 0 0 1 4-4h4a4 4 0 0 1 4 4v1"/><circle cx="17" cy="9" r="2.5"/><path d="M21 21v-1a3 3 0 0 0-3-3"/></svg>;
    case 'book':       return <svg {...p}><path d="M4 4h11a3 3 0 0 1 3 3v13H7a3 3 0 0 1-3-3z"/><path d="M4 17a3 3 0 0 1 3-3h11"/></svg>;
    case 'doc':        return <svg {...p}><path d="M14 3H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9z"/><path d="M14 3v6h6"/><path d="M8 14h8M8 18h5"/></svg>;
    case 'search':     return <svg {...p}><circle cx="11" cy="11" r="7"/><path d="M21 21l-4.3-4.3"/></svg>;
    case 'chevron':    return <svg {...p}><path d="M9 6l6 6-6 6"/></svg>;
    case 'chevronL':   return <svg {...p}><path d="M15 6l-6 6 6 6"/></svg>;
    case 'plus':       return <svg {...p}><path d="M12 5v14M5 12h14"/></svg>;
    case 'spark':      return <svg {...p}><path d="M12 3l1.8 5.2L19 10l-5.2 1.8L12 17l-1.8-5.2L5 10l5.2-1.8z"/><path d="M19 17l.7 2 2 .7-2 .7-.7 2-.7-2-2-.7 2-.7z"/></svg>;
    case 'sun':        return <svg {...p}><circle cx="12" cy="12" r="4"/><path d="M12 2v2M12 20v2M4 12H2M22 12h-2M5 5l1.4 1.4M17.6 17.6L19 19M5 19l1.4-1.4M17.6 6.4L19 5"/></svg>;
    case 'moon':       return <svg {...p}><path d="M21 13A9 9 0 1 1 11 3a7 7 0 0 0 10 10z"/></svg>;
    case 'filter':     return <svg {...p}><path d="M4 5h16l-6 8v6l-4-2v-4z"/></svg>;
    case 'calendar':   return <svg {...p}><rect x="3" y="5" width="18" height="16" rx="2"/><path d="M3 9h18M8 3v4M16 3v4"/></svg>;
    case 'wallet':     return <svg {...p}><path d="M3 7a2 2 0 0 1 2-2h13a2 2 0 0 1 2 2v2H5a2 2 0 0 1-2-2z"/><rect x="3" y="9" width="18" height="11" rx="2"/><circle cx="17" cy="14.5" r="1.2"/></svg>;
    case 'trend':      return <svg {...p}><path d="M3 17l6-6 4 4 7-7"/><path d="M14 8h6v6"/></svg>;
    case 'bell':       return <svg {...p}><path d="M6 8a6 6 0 0 1 12 0c0 6 3 7 3 7H3s3-1 3-7"/><path d="M10 21a2 2 0 0 0 4 0"/></svg>;
    case 'send':       return <svg {...p}><path d="M22 2L11 13"/><path d="M22 2l-7 20-4-9-9-4z"/></svg>;
    case 'check':      return <svg {...p}><path d="M5 12l5 5L20 7"/></svg>;
    case 'clock':      return <svg {...p}><circle cx="12" cy="12" r="9"/><path d="M12 7v5l3 2"/></svg>;
    case 'feather':    return <svg {...p}><path d="M20 4c-7 0-13 6-13 13v3h3c7 0 13-6 13-13z"/><path d="M16 8L4 20"/><path d="M14 14H9"/></svg>;
    case 'dots':       return <svg {...p}><circle cx="5" cy="12" r="1.4"/><circle cx="12" cy="12" r="1.4"/><circle cx="19" cy="12" r="1.4"/></svg>;
    case 'menu':       return <svg {...p}><path d="M4 6h16M4 12h16M4 18h16"/></svg>;
    case 'mic':        return <svg {...p}><rect x="9" y="3" width="6" height="12" rx="3"/><path d="M5 11a7 7 0 0 0 14 0M12 18v3"/></svg>;
    case 'pin':        return <svg {...p}><path d="M12 22s7-8 7-13a7 7 0 1 0-14 0c0 5 7 13 7 13z"/><circle cx="12" cy="9" r="2.5"/></svg>;
    case 'share':      return <svg {...p}><path d="M12 4v12M7 9l5-5 5 5"/><path d="M5 16v3a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-3"/></svg>;
    case 'pie':        return <svg {...p}><path d="M12 3v9h9"/><path d="M21 12a9 9 0 1 1-9-9"/></svg>;
    case 'shield':     return <svg {...p}><path d="M12 3l8 3v6c0 5-4 8-8 9-4-1-8-4-8-9V6z"/><path d="M9 12l2 2 4-4"/></svg>;
    default: return null;
  }
};

window.T = T;
window.Icon = Icon;
