const { useState, useEffect, useCallback, useMemo, useRef } = React;

// --- Web Audio Chime Synthesizer ---
class AudioChimeEngine {
  constructor() {
    this.ctx = null;
    this.enabled = true;
  }

  init() {
    if (!this.ctx) {
      const AudioCtx = window.AudioContext || window.webkitAudioContext;
      if (AudioCtx) this.ctx = new AudioCtx();
    }
    if (this.ctx && this.ctx.state === 'suspended') {
      this.ctx.resume();
    }
  }

  playTone(freq, duration, type = 'sine', delay = 0) {
    if (!this.enabled) return;
    this.init();
    if (!this.ctx) return;

    setTimeout(() => {
      try {
        const osc = this.ctx.createOscillator();
        const gain = this.ctx.createGain();
        osc.type = type;
        osc.frequency.setValueAtTime(freq, this.ctx.currentTime);
        gain.gain.setValueAtTime(0.15, this.ctx.currentTime);
        gain.gain.exponentialRampToValueAtTime(0.001, this.ctx.currentTime + duration);
        osc.connect(gain);
        gain.connect(this.ctx.destination);
        osc.start();
        osc.stop(this.ctx.currentTime + duration);
      } catch (e) {
        console.warn('Audio playback error', e);
      }
    }, delay * 1000);
  }

  playSuccess() {
    this.playTone(523.25, 0.12, 'sine', 0);
    this.playTone(659.25, 0.12, 'sine', 0.08);
    this.playTone(783.99, 0.20, 'sine', 0.16);
    this.playTone(1046.50, 0.35, 'sine', 0.24);
  }

  playAlert() {
    this.playTone(440, 0.12, 'triangle', 0);
    this.playTone(330, 0.25, 'triangle', 0.12);
  }

  playPop() {
    this.playTone(880, 0.05, 'sine', 0);
  }

  playDing() {
    this.playTone(987.77, 0.35, 'sine', 0);
  }
}

const chimeEngine = new AudioChimeEngine();

// --- Avatar Presets (Matching Android Mobile App) ---
const AVATAR_PRESETS = [
  { id: 'p1', name: 'Sarah J. (Client Lead)', icon: 'person', bg: '#059669' },
  { id: 'p2', name: 'Alex C. (Staff Lead)', icon: 'badge', bg: '#0284C7' },
  { id: 'p3', name: 'Daniel M. (Executive Lead)', icon: 'verified_user', bg: '#7C3AED' },
  { id: 'p4', name: 'Marcus R. (Security)', icon: 'shield', bg: '#D97706' },
  { id: 'p5', name: 'Elena K. (QA Lead)', icon: 'bug_report', bg: '#DC2626' },
  { id: 'p6', name: 'David L. (Mobile Dev)', icon: 'smartphone', bg: '#0891B2' },
  { id: 'p7', name: 'Taylor W. (UI/UX)', icon: 'palette', bg: '#DB2777' },
  { id: 'p8', name: 'Enterprise Admin', icon: 'admin_panel_settings', bg: '#475569' }
];

// --- Sneksoft Infinity Logo SVG ---
function SneksoftLogo({ className = "sneksoft-infinity-logo-svg" }) {
  return (
    <svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="512" height="512" className={className} viewBox="0 0 512 512">
<path d="M0 0 C0.74999268 -0.00056396 1.49998535 -0.00112793 2.27270508 -0.00170898 C7.63529406 0.10418869 11.8573061 1.06430363 16.72265625 3.41796875 C19.33492613 4.6511212 21.89123322 5.07407718 24.75 5.375 C24.75 6.035 24.75 6.695 24.75 7.375 C27.31018518 9.58921421 29.93300938 11.49700625 32.75 13.375 C34.10573748 14.68554623 35.43612831 16.02248503 36.75 17.375 C39.35220154 20.04066987 41.64507954 22.30505302 44.75 24.375 C45.08 25.365 45.41 26.355 45.75 27.375 C46.3275 27.66375 46.905 27.9525 47.5 28.25 C49.75 29.375 49.75 29.375 52.0625 31.75 C54.63252693 34.26025886 56.86527096 35.7259737 59.98046875 37.40234375 C62.68475623 38.8888064 65.20219047 40.63785714 67.75 42.375 C68.74 43.035 69.73 43.695 70.75 44.375 C73.4722338 46.849758 75.28675141 48.99827248 76.75 52.375 C77.81201737 54.60239701 77.81201737 54.60239701 79.75 57.375 C79.875 60.5625 79.875 60.5625 79.75 63.375 C80.08 63.375 80.41 63.375 80.75 63.375 C80.75 67.665 80.75 71.955 80.75 76.375 C81.41 76.705 82.07 77.035 82.75 77.375 C81.43 77.705 80.11 78.035 78.75 78.375 C81.39 78.375 84.03 78.375 86.75 78.375 C86.42 79.035 86.09 79.695 85.75 80.375 C91.94828226 83.96088823 91.94828226 83.96088823 98.5 86.8125 C101.560681 88.28398125 102.45662219 88.96519891 104.4375 91.5 C106.41163811 94.39799114 106.41163811 94.39799114 108.6875 95.25 C111.38173172 95.41328677 114.05185121 95.43632156 116.75 95.375 C119.75 101.375 119.75 101.375 119.0078125 103.84375 C118.63398438 104.8440625 118.26015625 105.844375 117.875 106.875 C116.1179604 111.83534989 115.28670998 116.16415414 115.21875 121.4140625 C114.75 123.375 114.75 123.375 112.88671875 124.71875 C110.75 125.375 110.75 125.375 108.0625 124.25 C105.47317634 122.15054838 105.32087893 121.5148341 104.75 118.375 C103.76268258 117.03224831 102.76405257 115.69767727 101.75 114.375 C101.75 113.715 101.75 113.055 101.75 112.375 C99.94607555 110.33374533 99.94607555 110.33374533 97.9375 109.5625 C94.98358219 107.95894462 92.98766424 105.8612936 90.75 103.375 C90.75 102.715 90.75 102.055 90.75 101.375 C86.46 100.715 82.17 100.055 77.75 99.375 C77.42 100.365 77.09 101.355 76.75 102.375 C73.25888355 107.54702437 69.50631738 109.7914916 63.40673828 111.08276367 C61.63145752 111.31056519 61.63145752 111.31056519 59.8203125 111.54296875 C58.53125 111.71376953 57.2421875 111.88457031 55.9140625 112.06054688 C54.56773767 112.22810044 53.22138309 112.39541522 51.875 112.5625 C50.50507903 112.74054436 49.13528542 112.91957163 47.765625 113.09960938 C44.42820747 113.53441377 41.08982808 113.95918918 37.75 114.375 C37.75 115.035 37.75 115.695 37.75 116.375 C34.72265625 116.32617188 34.72265625 116.32617188 31.6953125 116.27734375 C29.66814596 116.24850758 29.66814596 116.24850758 27.75 117.375 C28.08 118.035 28.41 118.695 28.75 119.375 C20.17 119.375 11.59 119.375 2.75 119.375 C3.08 118.715 3.41 118.055 3.75 117.375 C1.44 117.045 -0.87 116.715 -3.25 116.375 C-2.92 115.715 -2.59 115.055 -2.25 114.375 C-2.87648438 114.27703125 -3.50296875 114.1790625 -4.1484375 114.078125 C-4.96570313 113.92859375 -5.78296875 113.7790625 -6.625 113.625 C-7.43710938 113.48578125 -8.24921875 113.3465625 -9.0859375 113.203125 C-11.89571788 112.12790218 -12.03165795 111.04749225 -13.25 108.375 C-15.1790596 106.62783081 -15.1790596 106.62783081 -17.375 105.125 C-18.46167969 104.34382813 -18.46167969 104.34382813 -19.5703125 103.546875 C-20.12460938 103.16015625 -20.67890625 102.7734375 -21.25 102.375 C-23.71800047 103.52673355 -25.29783565 104.42283565 -27.25 106.375 C-27.91 107.035 -28.57 107.695 -29.25 108.375 C-29.745 109.86 -29.745 109.86 -30.25 111.375 C-31.24 111.87 -31.24 111.87 -32.25 112.375 C-32.90772428 115.40434491 -32.90772428 115.40434491 -33.25 118.375 C-33.91 118.375 -34.57 118.375 -35.25 118.375 C-35.37375 119.48875 -35.4975 120.6025 -35.625 121.75 C-36.25 125.375 -36.25 125.375 -38.25 127.375 C-38.58 128.550625 -38.91 129.72625 -39.25 130.9375 C-39.58 132.071875 -39.91 133.20625 -40.25 134.375 C-40.91 134.705 -41.57 135.035 -42.25 135.375 C-42.20875 136.1175 -42.1675 136.86 -42.125 137.625 C-42.31229757 141.74554648 -43.98832215 143.98248323 -46.25 147.375 C-47.92902666 152.57382107 -49.48364954 157.93789467 -49.3125 163.4375 C-49.23158023 168.53544539 -49.90695981 173.45051929 -51.25 178.375 C-51.91 179.035 -52.57 179.695 -53.25 180.375 C-54.14036793 184.69531785 -54.45153556 189.11237776 -54.875 193.5 C-54.9407019 194.16850983 -55.00640381 194.83701965 -55.07409668 195.52578735 C-56.25503814 207.86771575 -56.52387399 220.16959873 -56.5 232.5625 C-56.49913391 233.41322083 -56.49826782 234.26394165 -56.49737549 235.14044189 C-56.75519118 249.33630031 -56.75519118 249.33630031 -55.25 263.375 C-54.59 263.705 -53.93 264.035 -53.25 264.375 C-53.28480469 265.46554687 -53.31960937 266.55609375 -53.35546875 267.6796875 C-53.71165882 283.90996064 -51.48335455 299.95037606 -46.25 315.375 C-45.59 316.035 -44.93 316.695 -44.25 317.375 C-43.8149349 319.48492355 -43.47300761 321.61469102 -43.1875 323.75 C-42.78829691 330.3117911 -42.78829691 330.3117911 -39.75 335.6875 C-37.47229271 338.2499207 -37.66650253 341.04297976 -37.25 344.375 C-35.43333414 347.25208454 -35.43333414 347.25208454 -33.6875 349.125 C-31.77014306 352.12608042 -31.58698487 354.87035739 -31.25 358.375 C-30.59 358.375 -29.93 358.375 -29.25 358.375 C-29.12625 359.15875 -29.0025 359.9425 -28.875 360.75 C-28.45882007 363.51557822 -28.45882007 363.51557822 -26.25 365.375 C-25.92 365.375 -25.59 365.375 -25.25 365.375 C-25.0025 366.2825 -24.755 367.19 -24.5 368.125 C-23.19402638 371.52053141 -21.94922785 373.01317563 -19.25 375.375 C-13.25 381.375 -13.25 381.375 -12.25 384.375 C-10.37612784 385.17712628 -10.37612784 385.17712628 -8.1875 385.5625 C-7.45402344 385.72105469 -6.72054687 385.87960937 -5.96484375 386.04296875 C-5.39894531 386.15253906 -4.83304687 386.26210938 -4.25 386.375 C-4.58 387.035 -4.91 387.695 -5.25 388.375 C-0.14259717 389.41128463 4.75282461 389.52522956 9.9375 389.5 C10.74380859 389.50386719 11.55011719 389.50773437 12.38085938 389.51171875 C13.15623047 389.51042969 13.93160156 389.50914062 14.73046875 389.5078125 C15.43067139 389.50668457 16.13087402 389.50555664 16.85229492 389.50439453 C18.97507516 389.4393968 18.97507516 389.4393968 21.75 388.375 C21.42 387.715 21.09 387.055 20.75 386.375 C23.39 385.715 26.03 385.055 28.75 384.375 C28.75 383.715 28.75 383.055 28.75 382.375 C30.07 382.045 31.39 381.715 32.75 381.375 C32.42 380.715 32.09 380.055 31.75 379.375 C32.33394531 379.12492187 32.91789062 378.87484375 33.51953125 378.6171875 C36.04692051 377.20963972 37.54303954 375.67801311 39.4375 373.5 C40.03949219 372.82195312 40.64148438 372.14390625 41.26171875 371.4453125 C42.75766194 369.36434166 43.3289756 367.87869174 43.75 365.375 C44.74 365.375 45.73 365.375 46.75 365.375 C46.42 364.385 46.09 363.395 45.75 362.375 C47.75 360.375 47.75 360.375 49.75 359.375 C49.915 358.385 50.08 357.395 50.25 356.375 C50.415 355.385 50.58 354.395 50.75 353.375 C51.41 353.045 52.07 352.715 52.75 352.375 C53.0949145 351.04461551 53.42516582 349.71042939 53.75 348.375 C54.71887581 346.35973831 55.7141321 344.35666034 56.75 342.375 C57.74 342.375 58.73 342.375 59.75 342.375 C59.42 341.055 59.09 339.735 58.75 338.375 C60.07 338.045 61.39 337.715 62.75 337.375 C62.55543213 336.79524414 62.36086426 336.21548828 62.16040039 335.61816406 C61.67422554 332.96083238 62.06770718 331.91191771 63.18359375 329.484375 C63.50263672 328.77539062 63.82167969 328.06640625 64.15039062 327.3359375 C64.49263672 326.60632813 64.83488281 325.87671875 65.1875 325.125 C65.52587891 324.37992187 65.86425781 323.63484375 66.21289062 322.8671875 C67.04826304 321.03172135 67.89777967 319.20270445 68.75 317.375 C69.74 317.375 70.73 317.375 71.75 317.375 C71.54375 316.7975 71.3375 316.22 71.125 315.625 C70.65592292 312.81053751 71.34215238 311.79962646 72.75 309.375 C73.08 308.385 73.41 307.395 73.75 306.375 C74.69538852 303.95604816 75.66879516 301.54907287 76.640625 299.140625 C77.37013492 297.32198759 78.089212 295.49912425 78.796875 293.671875 C81.4375 286.8875 81.4375 286.8875 83.3125 283.8125 C84.63301314 281.57336902 85.3483609 279.71008027 86.125 277.25 C87.86815954 271.7438294 90.26580984 266.5811411 92.75 261.375 C93.08902344 260.62863281 93.42804688 259.88226563 93.77734375 259.11328125 C94.75 257.375 94.75 257.375 96.75 256.375 C96.87375 255.55 96.9975 254.725 97.125 253.875 C97.81540262 250.00874532 99.15262956 246.95910841 100.8125 243.42578125 C101.85028055 241.25219712 101.85028055 241.25219712 102.75 238.375 C104.3125 236.6875 104.3125 236.6875 105.75 235.375 C108.76191399 237.11873968 110.47504283 238.49347904 111.52734375 241.8671875 C112.01214204 244.36549108 112.42726329 246.85090991 112.75 249.375 C113.41 249.045 114.07 248.715 114.75 248.375 C115.08 250.355 115.41 252.335 115.75 254.375 C115.09 254.705 114.43 255.035 113.75 255.375 C114.74 255.375 115.73 255.375 116.75 255.375 C116.85957031 256.11105469 116.96914063 256.84710938 117.08203125 257.60546875 C118.11435933 263.95890254 119.22999487 268.38832725 123.4375 273.375 C125.06861958 275.86051555 124.99293723 277.45975321 124.75 280.375 C125.41 280.375 126.07 280.375 126.75 280.375 C126.9898748 282.01985575 127.22670126 283.66520637 127.44921875 285.3125 C127.64747589 286.67197754 127.87864037 288.02711754 128.14453125 289.375 C129.08594965 294.67177164 128.23313574 297.60737939 125.75 302.375 C124.76 302.375 123.77 302.375 122.75 302.375 C123.41 302.705 124.07 303.035 124.75 303.375 C123.46484276 307.65885745 121.74140961 311.4513694 119.703125 315.40625 C118.45439484 317.98559426 117.57243411 320.63355297 116.75 323.375 C115.76 323.375 114.77 323.375 113.75 323.375 C114.41 323.705 115.07 324.035 115.75 324.375 C113.875 330.25 113.875 330.25 112.75 331.375 C112.26694396 332.78342847 111.81321435 334.20198135 111.375 335.625 C110.21258468 339.20911389 108.85133662 342.22299508 106.75 345.375 C105.74983813 347.37532373 105.25603992 349.20625748 104.75 351.375 C103.76 351.375 102.77 351.375 101.75 351.375 C102.41 351.705 103.07 352.035 103.75 352.375 C103.42 354.025 103.09 355.675 102.75 357.375 C101.76 357.375 100.77 357.375 99.75 357.375 C99.95625 357.99375 100.1625 358.6125 100.375 359.25 C100.49875 359.95125 100.6225 360.6525 100.75 361.375 C100.09 362.035 99.43 362.695 98.75 363.375 C98.10232207 365.94561311 98.10232207 365.94561311 97.75 368.375 C96.76 368.375 95.77 368.375 94.75 368.375 C94.75 370.355 94.75 372.335 94.75 374.375 C94.09 374.375 93.43 374.375 92.75 374.375 C92.46125 375.344375 92.1725 376.31375 91.875 377.3125 C90.75 380.375 90.75 380.375 88.75 381.375 C88.98589844 381.89578125 89.22179687 382.4165625 89.46484375 382.953125 C89.89362169 386.59480067 88.08902028 389.08049255 86.3125 392.125 C85.97412109 392.72699219 85.63574219 393.32898438 85.28710938 393.94921875 C84.45231735 395.43068065 83.60258506 396.90370608 82.75 398.375 C82.09 398.375 81.43 398.375 80.75 398.375 C80.5953125 399.48875 80.5953125 399.48875 80.4375 400.625 C79.6924788 403.60508479 78.61812663 404.98379792 76.75 407.375 C76.440625 408.179375 76.13125 408.98375 75.8125 409.8125 C74.21625431 413.66226901 71.67331533 416.45168467 68.75 419.375 C67.19159149 421.32301064 65.87306141 423.11246899 64.8125 425.375 C63.48570264 427.87250092 61.8709809 429.51914171 59.75 431.375 C59.09 431.375 58.43 431.375 57.75 431.375 C58.08 432.365 58.41 433.355 58.75 434.375 C57.96625 434.7875 57.1825 435.2 56.375 435.625 C53.68053835 437.10067682 53.68053835 437.10067682 52.8125 439.3125 C51.22351785 442.39699477 48.6550075 443.60673456 45.75 445.375 C46.08 446.035 46.41 446.695 46.75 447.375 C44.44 448.035 42.13 448.695 39.75 449.375 C40.08 450.035 40.41 450.695 40.75 451.375 C38.77 452.035 36.79 452.695 34.75 453.375 C34.75 454.035 34.75 454.695 34.75 455.375 C33.1 455.705 31.45 456.035 29.75 456.375 C29.75 457.035 29.75 457.695 29.75 458.375 C27.76432292 458.34244792 25.77864583 458.30989583 23.79296875 458.27734375 C21.54694539 458.29236783 21.54694539 458.29236783 18.75 459.375 C19.74 460.035 20.73 460.695 21.75 461.375 C15.37641289 462.33705088 9.19070471 462.48155578 2.75 462.375 C3.08 461.715 3.41 461.055 3.75 460.375 C-2.08799592 458.67667391 -7.18107371 458.12212807 -13.25 458.375 C-12.92 457.715 -12.59 457.055 -12.25 456.375 C-13.9 456.045 -15.55 455.715 -17.25 455.375 C-17.25 454.715 -17.25 454.055 -17.25 453.375 C-19.84961705 451.48436942 -22.38078582 449.77009736 -25.3125 448.4375 C-28.12325294 446.89611935 -30.05438583 444.68617281 -32.25 442.375 C-32.91 441.715 -33.57 441.055 -34.25 440.375 C-38.25 435.66911765 -38.25 435.66911765 -38.25 433.375 C-38.91 433.375 -39.57 433.375 -40.25 433.375 C-40.58 432.715 -40.91 432.055 -41.25 431.375 C-42.24 430.715 -43.23 430.055 -44.25 429.375 C-44.25 428.715 -44.25 428.055 -44.25 427.375 C-45.24 427.045 -46.23 426.715 -47.25 426.375 C-47.311875 425.67375 -47.37375 424.9725 -47.4375 424.25 C-48.51225416 420.44702373 -50.67211849 418.33013247 -53.25 415.375 C-54.4375 413.25 -54.4375 413.25 -55.25 411.375 C-56.55628723 408.22974188 -56.55628723 408.22974188 -59.25 406.375 C-58.92 405.055 -58.59 403.735 -58.25 402.375 C-59.24 402.375 -60.23 402.375 -61.25 402.375 C-61.89757625 400.93828432 -62.54299453 399.50059584 -63.1875 398.0625 C-63.54714844 397.26199219 -63.90679687 396.46148437 -64.27734375 395.63671875 C-66.35509693 390.80531678 -67.39589402 386.62718489 -67.25 381.375 C-68.24 381.375 -69.23 381.375 -70.25 381.375 C-70.1571875 380.2303125 -70.1571875 380.2303125 -70.0625 379.0625 C-70.28729792 375.84039649 -71.01784843 375.51414525 -73.25 373.375 C-73.25 372.055 -73.25 370.735 -73.25 369.375 C-73.91 369.045 -74.57 368.715 -75.25 368.375 C-75.8828125 366.23046875 -75.8828125 366.23046875 -76.375 363.5625 C-76.54257813 362.68980469 -76.71015625 361.81710937 -76.8828125 360.91796875 C-77.25 358.375 -77.25 358.375 -77.25 354.375 C-77.69896307 352.61121652 -78.20193264 350.86054665 -78.75 349.125 C-79.0284375 348.23296875 -79.306875 347.3409375 -79.59375 346.421875 C-79.8103125 345.74640625 -80.026875 345.0709375 -80.25 344.375 C-80.91 344.375 -81.57 344.375 -82.25 344.375 C-82.31058594 343.68792969 -82.37117188 343.00085938 -82.43359375 342.29296875 C-82.55927734 340.94138672 -82.55927734 340.94138672 -82.6875 339.5625 C-82.80931641 338.22251953 -82.80931641 338.22251953 -82.93359375 336.85546875 C-83.18489767 334.24756441 -83.18489767 334.24756441 -84.25 331.375 C-84.43488614 330.02590084 -84.58664919 328.67206756 -84.71484375 327.31640625 C-85.23602503 322.28308015 -86.00277771 317.30643318 -86.8125 312.3125 C-86.95107422 311.44689453 -87.08964844 310.58128906 -87.23242188 309.68945312 C-87.56970697 307.58432889 -87.90957836 305.4796193 -88.25 303.375 C-88.91 303.375 -89.57 303.375 -90.25 303.375 C-91.12051098 298.92595781 -91.32573338 294.79004222 -91.25 290.26171875 C-91.16825315 281.43170054 -91.62033406 272.65356398 -92.1050415 263.83932495 C-92.91567029 249.00993795 -93.58135947 234.23094956 -93.25 219.375 C-93.58 219.375 -93.91 219.375 -94.25 219.375 C-94.49396288 188.6769629 -94.49396288 188.6769629 -93.25 182.375 C-92.59 182.045 -91.93 181.715 -91.25 181.375 C-90.72181026 179.58517688 -90.72181026 179.58517688 -90.47216797 177.39697266 C-90.35219452 176.55163971 -90.23222107 175.70630676 -90.10861206 174.83535767 C-89.98769196 173.91258026 -89.86677185 172.98980286 -89.7421875 172.0390625 C-89.61184113 171.08993988 -89.48149475 170.14081726 -89.34719849 169.16293335 C-89.07224484 167.14421491 -88.80186616 165.12486901 -88.53564453 163.10498047 C-88.1310897 160.04604564 -87.70932193 156.98986338 -87.28515625 153.93359375 C-87.01978494 151.96889132 -86.75543137 150.00405111 -86.4921875 148.0390625 C-86.36721893 147.1365274 -86.24225037 146.23399231 -86.11349487 145.30410767 C-85.39968772 139.79773086 -85.15749137 134.46516169 -85.3039856 128.91293335 C-85.21844169 124.89140285 -84.26807566 121.25641344 -83.25 117.375 C-82.59 117.375 -81.93 117.375 -81.25 117.375 C-81.09144531 116.56160156 -80.93289062 115.74820313 -80.76953125 114.91015625 C-79.20418023 107.22177474 -77.3014525 99.78674308 -74.8762207 92.32641602 C-73.4811678 87.86256705 -73.12816068 84.09772396 -73.25 79.375 C-72.25 76.4375 -72.25 76.4375 -71.25 74.375 C-70.59 74.375 -69.93 74.375 -69.25 74.375 C-68.981875 73.240625 -68.71375 72.10625 -68.4375 70.9375 C-66.65377664 63.82772943 -64.23825322 57.0629953 -61.25 50.375 C-60.59 50.375 -59.93 50.375 -59.25 50.375 C-59.064375 49.1684375 -59.064375 49.1684375 -58.875 47.9375 C-58.66875 47.091875 -58.4625 46.24625 -58.25 45.375 C-57.59 45.045 -56.93 44.715 -56.25 44.375 C-55.90657551 43.04423011 -55.57380126 41.71068021 -55.25 40.375 C-54.59 39.715 -53.93 39.055 -53.25 38.375 C-52.6074765 36.30625966 -52.6074765 36.30625966 -52.25 34.375 C-51.59 34.375 -50.93 34.375 -50.25 34.375 C-50.064375 33.446875 -50.064375 33.446875 -49.875 32.5 C-49.25 30.375 -49.25 30.375 -47.25 28.375 C-46.92 27.715 -46.59 27.055 -46.25 26.375 C-45.610625 26.106875 -44.97125 25.83875 -44.3125 25.5625 C-42.01518285 24.52803573 -42.01518285 24.52803573 -41.3125 21.9375 C-39.94885459 18.64870814 -38.27307929 18.11327059 -35.25 16.375 C-34.940625 15.715 -34.63125 15.055 -34.3125 14.375 C-32.72722795 11.3909585 -30.24399633 10.78034521 -27.25 9.375 C-25.41310524 7.87613129 -25.41310524 7.87613129 -24.25 6.375 C-24.25 6.045 -24.25 5.715 -24.25 5.375 C-23.59773438 5.18164062 -22.94546875 4.98828125 -22.2734375 4.7890625 C-21.39945312 4.52867188 -20.52546875 4.26828125 -19.625 4 C-18.76648438 3.74476562 -17.90796875 3.48953125 -17.0234375 3.2265625 C-15.13790195 2.64762342 -13.27207396 2.00116678 -11.4296875 1.296875 C-7.59216327 0.18427584 -3.96344705 -0.00752918 0 0 Z M6.75 47.375 C8.235 48.365 8.235 48.365 9.75 49.375 C10.41 49.045 11.07 48.715 11.75 48.375 C10.1 48.045 8.45 47.715 6.75 47.375 Z M7.75 49.375 C8.75 51.375 8.75 51.375 8.75 51.375 Z M9.75 51.375 C10.02268725 55.2835172 10.58606049 57.16096786 13 60.3125 C15.52708333 62.6375 15.52708333 62.6375 18.375 62.375 C20.85694963 61.32996857 22.16505412 60.5438733 23.75 58.375 C24.06092355 55.43154593 24.06092355 55.43154593 22.5 53.80078125 C20.63104421 52.27808289 18.99599084 51.42601542 16.75 50.5625 C16.069375 50.28792969 15.38875 50.01335937 14.6875 49.73046875 C12.43210759 49.08444793 12.43210759 49.08444793 9.75 51.375 Z M-62.25 55.375 C-61.25 57.375 -61.25 57.375 -61.25 57.375 Z M23.75 55.375 C25.235 56.365 25.235 56.365 26.75 57.375 C26.75 56.715 26.75 56.055 26.75 55.375 C25.76 55.375 24.77 55.375 23.75 55.375 Z M76.75 56.375 C77.75 58.375 77.75 58.375 77.75 58.375 Z M77.75 58.375 C78.75 62.375 78.75 62.375 78.75 62.375 Z M-64.25 59.375 C-63.25 61.375 -63.25 61.375 -63.25 61.375 Z M-71.25 77.375 C-70.25 79.375 -70.25 79.375 -70.25 79.375 Z M-72.25 80.375 C-71.25 82.375 -71.25 82.375 -71.25 82.375 Z M113.75 109.375 C112.5922494 112.84825181 112.68133348 115.73567448 112.75 119.375 C113.08 119.375 113.41 119.375 113.75 119.375 C114.08 116.075 114.41 112.775 114.75 109.375 C114.42 109.375 114.09 109.375 113.75 109.375 Z M-37.25 121.375 C-36.25 123.375 -36.25 123.375 -36.25 123.375 Z M-83.25 122.375 C-82.25 125.375 -82.25 125.375 -82.25 125.375 Z M-84.25 126.375 C-84.25 128.025 -84.25 129.675 -84.25 131.375 C-83.92 131.375 -83.59 131.375 -83.25 131.375 C-83.25 129.725 -83.25 128.075 -83.25 126.375 C-83.58 126.375 -83.91 126.375 -84.25 126.375 Z M-41.25 129.375 C-40.25 131.375 -40.25 131.375 -40.25 131.375 Z M-51.25 163.375 C-50.25 166.375 -50.25 166.375 -50.25 166.375 Z M-52.25 167.375 C-51.25 171.375 -51.25 171.375 -51.25 171.375 Z M108.75 239.375 C109.75 241.375 109.75 241.375 109.75 241.375 Z M101.75 243.375 C102.75 245.375 102.75 245.375 102.75 245.375 Z M98.75 250.375 C99.75 252.375 99.75 252.375 99.75 252.375 Z M114.75 256.375 C115.75 258.375 115.75 258.375 115.75 258.375 Z M94.75 259.375 C95.75 261.375 95.75 261.375 95.75 261.375 Z M92.75 264.375 C93.75 266.375 93.75 266.375 93.75 266.375 Z M91.75 266.375 C92.75 268.375 92.75 268.375 92.75 268.375 Z M89.75 270.375 C90.75 272.375 90.75 272.375 90.75 272.375 Z M88.75 273.375 C89.75 275.375 89.75 275.375 89.75 275.375 Z M86.75 278.375 C87.75 280.375 87.75 280.375 87.75 280.375 Z M83.75 284.375 C84.75 286.375 84.75 286.375 84.75 286.375 Z M82.75 287.375 C83.75 289.375 83.75 289.375 83.75 289.375 Z M-90.25 289.375 C-90.25 291.685 -90.25 293.995 -90.25 296.375 C-89.92 296.375 -89.59 296.375 -89.25 296.375 C-89.25 294.065 -89.25 291.755 -89.25 289.375 C-89.58 289.375 -89.91 289.375 -90.25 289.375 Z M124.75 298.375 C125.75 300.375 125.75 300.375 125.75 300.375 Z M76.75 301.375 C77.75 303.375 77.75 303.375 77.75 303.375 Z M75.75 304.375 C76.75 306.375 76.75 306.375 76.75 306.375 Z M72.75 311.375 C73.75 313.375 73.75 313.375 73.75 313.375 Z M118.75 312.375 C119.75 314.375 119.75 314.375 119.75 314.375 Z M-46.25 319.375 C-45.25 321.375 -45.25 321.375 -45.25 321.375 Z M-45.25 322.375 C-44.25 324.375 -44.25 324.375 -44.25 324.375 Z M67.75 322.375 C68.75 324.375 68.75 324.375 68.75 324.375 Z M65.75 326.375 C66.75 328.375 66.75 328.375 66.75 328.375 Z M112.75 326.375 C113.75 328.375 113.75 328.375 113.75 328.375 Z M63.75 330.375 C64.75 332.375 64.75 332.375 64.75 332.375 Z M-82.25 336.375 C-81.25 338.375 -81.25 338.375 -81.25 338.375 Z M-40.25 337.375 C-39.25 339.375 -39.25 339.375 -39.25 339.375 Z M107.75 337.375 C108.75 339.375 108.75 339.375 108.75 339.375 Z M106.75 340.375 C107.75 342.375 107.75 342.375 107.75 342.375 Z M100.75 354.375 C101.75 356.375 101.75 356.375 101.75 356.375 Z M-76.25 358.375 C-75.25 360.375 -75.25 360.375 -75.25 360.375 Z M-75.25 361.375 C-74.25 363.375 -74.25 363.375 -74.25 363.375 Z M95.75 365.375 C96.75 367.375 96.75 367.375 96.75 367.375 Z M-66.25 386.375 C-65.25 388.375 -65.25 388.375 -65.25 388.375 Z M0.75 391.375 C0.75 391.705 0.75 392.035 0.75 392.375 C5.37 392.375 9.99 392.375 14.75 392.375 C14.75 392.045 14.75 391.715 14.75 391.375 C10.13 391.375 5.51 391.375 0.75 391.375 Z M-60.25 399.375 C-59.25 401.375 -59.25 401.375 -59.25 401.375 Z M76.75 403.375 C77.75 405.375 77.75 405.375 77.75 405.375 Z M72.75 410.375 C72.42 411.035 72.09 411.695 71.75 412.375 C72.41 412.375 73.07 412.375 73.75 412.375 C73.42 411.715 73.09 411.055 72.75 410.375 Z M70.75 413.375 C71.75 415.375 71.75 415.375 71.75 415.375 Z " fill="#75BE4B" transform="translate(154.25,18.625)"/>
<path d="M0 0 C-0.33 0.66 -0.66 1.32 -1 2 C1.31 2.33 3.62 2.66 6 3 C5.67 3.66 5.34 4.32 5 5 C6.26831693 5.81642254 7.53975931 6.62799105 8.8125 7.4375 C9.87404297 8.11619141 9.87404297 8.11619141 10.95703125 8.80859375 C13.08134552 10.14086339 13.08134552 10.14086339 16 11 C17.94702423 12.69306455 19.37551292 14.49664612 20.9375 16.5625 C22.90890121 18.89233779 24.20494288 19.90194184 27 21 C27 21.99 27 22.98 27 24 C28.31054623 25.35573748 29.64748503 26.68612831 31 28 C31.7734375 29.299375 31.7734375 29.299375 32.5625 30.625 C33.92617739 33.25743604 33.92617739 33.25743604 37 35 C37.94921875 37.1640625 37.94921875 37.1640625 38.6875 39.625 C39.06455078 40.85089844 39.06455078 40.85089844 39.44921875 42.1015625 C39.72185547 43.04128906 39.72185547 43.04128906 40 44 C40.66 44 41.32 44 42 44 C42.433125 45.7015625 42.433125 45.7015625 42.875 47.4375 C43.24625 48.613125 43.6175 49.78875 44 51 C44.66 51.33 45.32 51.66 46 52 C46 52.99 46 53.98 46 55 C46.66 55.99 47.32 56.98 48 58 C48.2165625 59.60875 48.2165625 59.60875 48.4375 61.25 C49.05840222 65.38934815 50.25531385 68.21984667 52 72 C53.11619429 75.34858286 53.50024026 78.50168184 54 82 C54.62789091 85.34127663 55.31415878 88.67019118 56 92 C57.98553772 101.63992949 57.98553772 101.63992949 58.5 106.0625 C58.665 107.031875 58.83 108.00125 59 109 C59.66 109.33 60.32 109.66 61 110 C63.64838975 121.06707781 63.31066358 132.75103824 63.26074219 144.05151367 C63.25002889 146.92973961 63.26069448 149.80733984 63.2734375 152.68554688 C63.291333 174.63790372 63.291333 174.63790372 61 185 C60.34 185.33 59.68 185.66 59 186 C58.42361862 188.0082409 58.42361862 188.0082409 58.10546875 190.4609375 C57.88262207 191.86811035 57.88262207 191.86811035 57.65527344 193.30371094 C57.42372559 194.82399902 57.42372559 194.82399902 57.1875 196.375 C55.77671055 205.12189457 53.97745459 213.61862953 51.57495117 222.14599609 C50.7190334 225.19261978 50 227.8172091 50 231 C49.34 230.67 48.68 230.34 48 230 C48.04125 231.258125 48.0825 232.51625 48.125 233.8125 C48.2390374 237.29064073 48.05925681 237.91111478 46 241 C44.46298388 244.38160494 44.46298388 244.38160494 44 248 C43.01 248 42.02 248 41 248 C41.20625 248.61875 41.4125 249.2375 41.625 249.875 C41.74875 250.57625 41.8725 251.2775 42 252 C41.34 252.66 40.68 253.32 40 254 C39.814375 254.9590625 39.814375 254.9590625 39.625 255.9375 C39 258 39 258 36.9375 259.5 C36.298125 259.995 35.65875 260.49 35 261 C35 262.32 35 263.64 35 265 C34.34 265 33.68 265 33 265 C33 265.99 33 266.98 33 268 C32.195625 268.639375 31.39125 269.27875 30.5625 269.9375 C27.87561287 271.73434261 27.87561287 271.73434261 27.1875 274.25 C27.125625 274.8275 27.06375 275.405 27 276 C25.68 276 24.36 276 23 276 C22.87625 276.61875 22.7525 277.2375 22.625 277.875 C21.65688858 281.16657884 19.83141467 282.11239022 17 284 C14.10461298 286.70143167 14.10461298 286.70143167 12 290 C10.35 290 8.7 290 7 290 C7.66 290.66 8.32 291.32 9 292 C3.25 293.125 3.25 293.125 1 292 C1 292.66 1 293.32 1 294 C-0.32 294.33 -1.64 294.66 -3 295 C-2.67 295.66 -2.34 296.32 -2 297 C-11.57 297 -21.14 297 -31 297 C-30.67 296.34 -30.34 295.68 -30 295 C-31.65 294.67 -33.3 294.34 -35 294 C-35 293.34 -35 292.68 -35 292 C-35.825 291.731875 -36.65 291.46375 -37.5 291.1875 C-41.36915561 289.87475078 -45.17994294 288.44898716 -49 287 C-49 286.34 -49 285.68 -49 285 C-51.01822917 284.609375 -53.03645833 284.21875 -55.0546875 283.828125 C-57.63199415 282.73095831 -57.80202946 281.47367198 -59 279 C-61.09206824 277.34577678 -61.09206824 277.34577678 -63.5 275.9375 C-66.59083876 274.04586654 -67.94364598 273.08453103 -70 270 C-72.05003955 268.80767387 -72.05003955 268.80767387 -74 268 C-74 267.01 -74 266.02 -74 265 C-75.69717974 262.75399568 -75.69717974 262.75399568 -77.875 260.5 C-80.1601428 258.04285721 -82.13365988 255.79951018 -84 253 C-86.05003955 251.80767387 -86.05003955 251.80767387 -88 251 C-88 250.34 -88 249.68 -88 249 C-88.66 248.67 -89.32 248.34 -90 248 C-90.66666667 246 -91.33333333 244 -92 242 C-92.96873032 240.64377755 -93.96434215 239.30582947 -95 238 C-95.33 237.01 -95.66 236.02 -96 235 C-96.99 234.67 -97.98 234.34 -99 234 C-99.12375 233.195625 -99.2475 232.39125 -99.375 231.5625 C-99.58125 230.716875 -99.7875 229.87125 -100 229 C-100.66 228.67 -101.32 228.34 -102 228 C-102 226.68 -102 225.36 -102 224 C-102.99 223.67 -103.98 223.34 -105 223 C-105.495 219.535 -105.495 219.535 -106 216 C-106.66 216 -107.32 216 -108 216 C-109.125 212.25 -109.125 212.25 -108 210 C-108.99 210 -109.98 210 -111 210 C-110.67 208.68 -110.34 207.36 -110 206 C-110.99 206 -111.98 206 -113 206 C-113.66 203.03 -114.32 200.06 -115 197 C-115.66 197 -116.32 197 -117 197 C-116.67 195.35 -116.34 193.7 -116 192 C-116.99 192 -117.98 192 -119 192 C-119.103125 191.0925 -119.20625 190.185 -119.3125 189.25 C-120.00414949 185.98038425 -120.82134921 184.46282263 -123 182 C-122 180 -122 180 -121 179 C-121.99 179 -122.98 179 -124 179 C-127 170.2 -127 170.2 -127 166 C-128.11940003 163.44137136 -129.44120681 161.33818978 -131 159 C-131.4140625 156.73828125 -131.4140625 156.73828125 -131.625 154.3125 C-131.69976562 153.50425781 -131.77453125 152.69601563 -131.8515625 151.86328125 C-131.90054687 151.24839844 -131.94953125 150.63351563 -132 150 C-132.66 150.33 -133.32 150.66 -134 151 C-133.91105469 149.61941406 -133.91105469 149.61941406 -133.8203125 148.2109375 C-133.82303213 142.81247244 -135.42485 137.78483605 -136.875 132.625 C-137.27912109 131.11099609 -137.27912109 131.11099609 -137.69140625 129.56640625 C-138.72204451 125.74261097 -138.72204451 125.74261097 -140 122 C-140.66 121.67 -141.32 121.34 -142 121 C-142 118.69 -142 116.38 -142 114 C-142.66 114 -143.32 114 -144 114 C-144.51588087 112.21284126 -145.0117162 110.41989509 -145.5 108.625 C-145.7784375 107.62726563 -146.056875 106.62953125 -146.34375 105.6015625 C-146.88817694 102.61369561 -147.05126373 100.22264995 -147.00390625 97.22265625 C-146.92164375 91.96380325 -147.5816017 86.99167995 -148.4375 81.8125 C-148.70715644 80.11069692 -148.97669001 78.40887436 -149.24609375 76.70703125 C-149.49738036 75.13801835 -149.74868121 73.56900774 -150 72 C-150.75006079 67.24623634 -151.21275985 62.62627476 -151.3125 57.8125 C-151.34988281 56.62269531 -151.38726562 55.43289062 -151.42578125 54.20703125 C-151 51 -151 51 -149.18359375 48.55859375 C-147 47 -147 47 -143.75 47.25 C-142.8425 47.4975 -141.935 47.745 -141 48 C-140.71125 48.969375 -140.4225 49.93875 -140.125 50.9375 C-139.35785318 54.10664203 -139.35785318 54.10664203 -137 55 C-136.67 55.99 -136.34 56.98 -136 58 C-135.18004605 59.83935616 -134.34516275 61.67208986 -133.5 63.5 C-132.1924408 66.32797687 -130.9857148 69.04285561 -130 72 C-129.36383848 73.42103612 -128.7169815 74.83730785 -128.0625 76.25 C-126.32906922 80.09859181 -125.11833793 83.92605469 -124 88 C-123.34964186 89.34136367 -122.6837045 90.67532254 -122 92 C-121.5359375 93.4540625 -121.5359375 93.4540625 -121.0625 94.9375 C-120.12357272 98.02152418 -120.12357272 98.02152418 -118.375 100.5625 C-116.83085568 103.29984674 -116.7351272 104.90981733 -117 108 C-116.01 108.33 -115.02 108.66 -114 109 C-111.68059158 112.77977668 -110.60831025 115.56084956 -111 120 C-110.34 120 -109.68 120 -109 120 C-108.71125 120.9075 -108.4225 121.815 -108.125 122.75 C-106.82883171 126.49448618 -105.80641022 129.19358978 -103 132 C-102.855625 132.61875 -102.71125 133.2375 -102.5625 133.875 C-101.8755331 136.47020829 -100.65627234 137.89780818 -99 140 C-97.28976984 142.69690141 -96.01253027 144.96240919 -95 148 C-94.62875 148.845625 -94.2575 149.69125 -93.875 150.5625 C-93.58625 151.366875 -93.2975 152.17125 -93 153 C-93.33 153.66 -93.66 154.32 -94 155 C-93.01 155.33 -92.02 155.66 -91 156 C-91 156.66 -91 157.32 -91 158 C-90.01 158.33 -89.02 158.66 -88 159 C-88 159.99 -88 160.98 -88 162 C-87.34 162.66 -86.68 163.32 -86 164 C-85 165 -85 165 -84 168 C-83.34 168.33 -82.68 168.66 -82 169 C-81.85151611 169.75651855 -81.70303223 170.51303711 -81.55004883 171.29248047 C-80.94134899 174.28869938 -79.98289183 175.86024732 -78.19921875 178.3203125 C-77.63396484 179.10277344 -77.06871094 179.88523437 -76.48632812 180.69140625 C-75.89271484 181.49449219 -75.29910156 182.29757812 -74.6875 183.125 C-74.10548828 183.93582031 -73.52347656 184.74664062 -72.92382812 185.58203125 C-70.17597381 189.34749413 -67.77155487 192.23633089 -64 195 C-62.9375 196.9375 -62.9375 196.9375 -62 199 C-61.46375 199.70125 -60.9275 200.4025 -60.375 201.125 C-59 203 -59 203 -59 205 C-57.576875 205.3403125 -57.576875 205.3403125 -56.125 205.6875 C-53 207 -53 207 -51.9375 209.375 C-51.4734375 210.674375 -51.4734375 210.674375 -51 212 C-48.05017052 214.79457529 -45.89035864 216.09224965 -42 217 C-40.25 218.4375 -40.25 218.4375 -39 220 C-39 220.66 -39 221.32 -39 222 C-37.7934375 222.4021875 -37.7934375 222.4021875 -36.5625 222.8125 C-34.73166225 223.42277925 -32.8997875 224.04279909 -31.125 224.80078125 C-24.0069584 227.64530166 -16.5627642 227.69824082 -9 227 C-5.95865509 225.33075929 -5.95865509 225.33075929 -5 223 C-2.35139573 222.40644386 0.29197322 222.25790731 3 222 C3 220.68 3 219.36 3 218 C3.78375 217.566875 4.5675 217.13375 5.375 216.6875 C8.98235207 214.36848796 9.04023052 212.0605632 10 208 C10.66 207.34 11.32 206.68 12 206 C12.33 205.01 12.66 204.02 13 203 C13.33 202.01 13.66 201.02 14 200 C14.69090908 197.77188759 15.37801556 195.54259447 16.0625 193.3125 C16.42472656 192.13300781 16.78695312 190.95351563 17.16015625 189.73828125 C17.43730469 188.83464844 17.71445312 187.93101562 18 187 C18.66 187 19.32 187 20 187 C24.1051361 168.32640417 27.29298044 148.09928657 24 129 C23.34 128.67 22.68 128.34 22 128 C21.62109375 126.03125 21.62109375 126.03125 21.4375 123.5 C21.32341797 122.14068359 21.32341797 122.14068359 21.20703125 120.75390625 C21.079192 119.05340307 20.95154715 117.35288525 20.82421875 115.65234375 C20.32511461 110.10348007 18.9586378 105.21071567 17 100 C16.34 100 15.68 100 15 100 C14.87625 99.46375 14.7525 98.9275 14.625 98.375 C13.87394317 95.52098405 13.04340771 92.76196159 12 90 C11.34 89.67 10.68 89.34 10 89 C9 87.1875 9 87.1875 8 85 C7.649375 84.29875 7.29875 83.5975 6.9375 82.875 C6.29166667 81.58333333 5.64583333 80.29166667 5 79 C4.01 78.34 3.02 77.68 2 77 C1.67 76.01 1.34 75.02 1 74 C-3.19911451 71.90044274 -8.69893904 72.77063079 -13.3125 72.75 C-14.45396484 72.729375 -15.59542969 72.70875 -16.77148438 72.6875 C-17.87427734 72.68234375 -18.97707031 72.6771875 -20.11328125 72.671875 C-21.12173096 72.6625293 -22.13018066 72.65318359 -23.16918945 72.64355469 C-27.72994987 73.21782896 -30.83498092 75.69450039 -34.1875 78.6875 C-37 81 -37 81 -39 81 C-39 81.66 -39 82.32 -39 83 C-39.66 83.474375 -40.32 83.94875 -41 84.4375 C-41.66 84.953125 -42.32 85.46875 -43 86 C-43 86.99 -43 87.98 -43 89 C-44.65 89.33 -46.3 89.66 -48 90 C-47.67 90.99 -47.34 91.98 -47 93 C-47.99 93.66 -48.98 94.32 -50 95 C-51.62548267 96.9505792 -52.89174761 98.77672944 -54 101.0625 C-55.0730969 103.14162525 -56.3204823 104.39350481 -58 106 C-58.33 106.66 -58.66 107.32 -59 108 C-59.515625 108.495 -60.03125 108.99 -60.5625 109.5 C-62.23063512 110.89439669 -62.23063512 110.89439669 -62 113 C-62.66 113.66 -63.32 114.32 -64 115 C-64.6425235 117.06874034 -64.6425235 117.06874034 -65 119 C-65.66 119 -66.32 119 -67 119 C-67.495 120.485 -67.495 120.485 -68 122 C-68.66 122.99 -69.32 123.98 -70 125 C-71.44414458 127.63344011 -72.37057415 130.06267935 -73 133 C-73.99 133 -74.98 133 -76 133 C-76.12375 133.721875 -76.2475 134.44375 -76.375 135.1875 C-76.9904931 137.95721894 -77.88444374 140.3970354 -79 143 C-79.66 143 -80.32 143 -81 143 C-81.185625 144.175625 -81.185625 144.175625 -81.375 145.375 C-82 148 -82 148 -84 150 C-86.26274788 149.64644564 -87.95088852 149.02455574 -90 148 C-90.144375 147.195625 -90.28875 146.39125 -90.4375 145.5625 C-90.76502717 142.65559342 -90.76502717 142.65559342 -94 141 C-94.67249326 138.98252022 -94.99429128 137.03767756 -95.3125 134.9375 C-95.8652227 132.81290783 -95.8652227 132.81290783 -98 131.5 C-100.39893156 129.70080133 -100.47841856 128.8686979 -101 126 C-101.63270867 124.65022151 -102.30062468 123.31647119 -103 122 C-103.309375 121.34 -103.61875 120.68 -103.9375 120 C-104.95517373 117.91700497 -104.95517373 117.91700497 -106.625 116.0625 C-108.32782957 113.50825565 -108.07720416 112.01096226 -108 109 C-108.66 108.01 -109.32 107.02 -110 106 C-110.046875 103.66015625 -110.046875 103.66015625 -109.75 101.0625 C-109.66234375 100.20785156 -109.5746875 99.35320312 -109.484375 98.47265625 C-108.74662381 94.7065554 -107.12020151 92.18030227 -105 89 C-105 88.34 -105 87.68 -105 87 C-104.34 87 -103.68 87 -103 87 C-102.9175 86.278125 -102.835 85.55625 -102.75 84.8125 C-101.84960277 81.43601039 -100.19816861 79.679018 -98 77 C-97.65657551 75.66923011 -97.32380126 74.33568021 -97 73 C-93.50704225 67.25352113 -93.50704225 67.25352113 -91 66 C-90.835 65.34 -90.67 64.68 -90.5 64 C-90.2525 63.01 -90.2525 63.01 -90 62 C-89.34 61.67 -88.68 61.34 -88 61 C-87.67 60.01 -87.34 59.02 -87 58 C-86.34 57.67 -85.68 57.34 -85 57 C-84.505 56.01 -84.505 56.01 -84 55 C-82.2620594 52.76550494 -80.50072707 50.566163 -78.625 48.4453125 C-75.64016099 45.21990531 -75.64016099 45.21990531 -75 41 C-73 39 -73 39 -70.6875 37.3125 C-66.87197567 34.02937441 -63.99719231 30.22901811 -61.9375 25.625 C-61.628125 25.08875 -61.31875 24.5525 -61 24 C-60.38125 23.855625 -59.7625 23.71125 -59.125 23.5625 C-55.98161162 22.73042661 -54.95995674 20.51119458 -53 18 C-51.67432801 17.31822584 -50.34246312 16.64808564 -49 16 C-48.67 15.01 -48.34 14.02 -48 13 C-45.78799466 9.74705096 -43.08969922 9.51119983 -39.40625 8.73046875 C-36.52107233 7.85461124 -34.18408275 6.48724406 -31.5625 5 C-21.8127601 -0.07928 -10.78909896 -0.12095402 0 0 Z M41 47 C42 49 42 49 42 49 Z M-137 60 C-136 62 -136 62 -136 62 Z M-134 67 C-133 69 -133 69 -133 69 Z M-21 70 C-21 70.33 -21 70.66 -21 71 C-15.72 71 -10.44 71 -5 71 C-10.50211216 68.24894392 -15.10119821 68.56998744 -21 70 Z M-131 74 C-130 76 -130 76 -130 76 Z M-128 82 C-127 84 -127 84 -127 84 Z M-101 82 C-100 84 -100 84 -100 84 Z M8 82 C8 82.66 8 83.32 8 84 C8.66 83.67 9.32 83.34 10 83 C9.34 82.67 8.68 82.34 8 82 Z M-127 84 C-126 86 -126 86 -126 86 Z M14 92 C15 94 15 94 15 94 Z M-146 98 C-145 101 -145 101 -145 101 Z M-145 101 C-144 104 -144 104 -144 104 Z M-120 101 C-119 103 -119 103 -119 103 Z M-144 105 C-144 106.65 -144 108.3 -144 110 C-143.67 110 -143.34 110 -143 110 C-143 108.35 -143 106.7 -143 105 C-143.33 105 -143.66 105 -144 105 Z M-115 112 C-114 114 -114 114 -114 114 Z M60 117 C60 119.97 60 122.94 60 126 C60.33 126 60.66 126 61 126 C61 123.03 61 120.06 61 117 C60.67 117 60.34 117 60 117 Z M22 119 C23 123 23 123 23 123 Z M61 127 C61 140.53 61 154.06 61 168 C61.33 168 61.66 168 62 168 C62 154.47 62 140.94 62 127 C61.67 127 61.34 127 61 127 Z M-75 130 C-74 132 -74 132 -74 132 Z M-105 133 C-104 135 -104 135 -104 135 Z M-101 140 C-100 142 -100 142 -100 142 Z M-131 154 C-130 156 -130 156 -130 156 Z M-130 157 C-129 159 -129 159 -129 159 Z M60 168 C60 170.97 60 173.94 60 177 C60.33 177 60.66 177 61 177 C61 174.03 61 171.06 61 168 C60.67 168 60.34 168 60 168 Z M-125 171 C-124 173 -124 173 -124 173 Z M-121 182 C-120 184 -120 184 -120 184 Z M18 192 C19 194 19 194 19 194 Z M-112 203 C-111 205 -111 205 -111 205 Z M-98 231 C-97 233 -97 233 -97 233 Z " fill="#709131" transform="translate(398,94)"/>
<path d="M0 0 C0.99 0.33 1.98 0.66 3 1 C3 5.29 3 9.58 3 14 C3.66 14.33 4.32 14.66 5 15 C3.68 15.33 2.36 15.66 1 16 C3.64 16 6.28 16 9 16 C8.67 16.66 8.34 17.32 8 18 C14.19828226 21.58588823 14.19828226 21.58588823 20.75 24.4375 C23.810681 25.90898125 24.70662219 26.59019891 26.6875 29.125 C28.66163811 32.02299114 28.66163811 32.02299114 30.9375 32.875 C33.63173172 33.03828677 36.30185121 33.06132156 39 33 C42 39 42 39 41.2578125 41.46875 C40.88398438 42.4690625 40.51015625 43.469375 40.125 44.5 C38.3679604 49.46034989 37.53670998 53.78915414 37.46875 59.0390625 C37 61 37 61 35.13671875 62.34375 C33 63 33 63 30.3125 61.875 C27.72317634 59.77554838 27.57087893 59.1398341 27 56 C26.01268258 54.65724831 25.01405257 53.32267727 24 52 C24 51.34 24 50.68 24 50 C22.19607555 47.95874533 22.19607555 47.95874533 20.1875 47.1875 C17.23358219 45.58394462 15.23766424 43.4862936 13 41 C13 40.34 13 39.68 13 39 C11.60974609 38.81824219 11.60974609 38.81824219 10.19140625 38.6328125 C8.99386719 38.46523437 7.79632813 38.29765625 6.5625 38.125 C5.36753906 37.96257812 4.17257813 37.80015625 2.94140625 37.6328125 C1.97074219 37.42398438 1.00007812 37.21515625 0 37 C-1.13495465 34.73009069 -1.12893026 33.47633001 -1.1328125 30.95703125 C-1.13474609 30.13686523 -1.13667969 29.31669922 -1.13867188 28.47167969 C-1.13416016 27.59415039 -1.12964844 26.71662109 -1.125 25.8125 C-1.12306641 24.92079102 -1.12113281 24.02908203 -1.11914062 23.11035156 C-1.06936237 15.37536405 -0.65389449 7.7066136 0 0 Z M36 47 C34.8422494 50.47325181 34.93133348 53.36067448 35 57 C35.33 57 35.66 57 36 57 C36.33 53.7 36.66 50.4 37 47 C36.67 47 36.34 47 36 47 Z " fill="#CC2D40" transform="translate(232,81)"/>
<path d="M0 0 C0.99 0.33 1.98 0.66 3 1 C3 5.29 3 9.58 3 14 C3.66 14.33 4.32 14.66 5 15 C3.68 15.33 2.36 15.66 1 16 C3.64 16 6.28 16 9 16 C8.67 16.66 8.34 17.32 8 18 C14.19828226 21.58588823 14.19828226 21.58588823 20.75 24.4375 C24.80266806 26.3858981 26.30200125 28.45405878 29 32 C29.66 32.33 30.32 32.66 31 33 C31 33.66 31 34.32 31 35 C30.113125 34.690625 29.22625 34.38125 28.3125 34.0625 C25.11748835 32.95606829 25.11748835 32.95606829 22.1875 32.5 C21.465625 32.335 20.74375 32.17 20 32 C19.67 31.34 19.34 30.68 19 30 C18.34 30 17.68 30 17 30 C15.36323743 31.9600281 15.36323743 31.9600281 14 34 C12.35 33.67 10.7 33.34 9 33 C8.77390663 35.12364481 8.77390663 35.12364481 10.5 36.625 C10.995 37.07875 11.49 37.5325 12 38 C10.02013918 37.88652381 8.04108402 37.7589065 6.0625 37.625 C4.96035156 37.55539063 3.85820312 37.48578125 2.72265625 37.4140625 C1.82417969 37.27742188 0.92570313 37.14078125 0 37 C-1.13495465 34.73009069 -1.12893026 33.47633001 -1.1328125 30.95703125 C-1.13474609 30.13686523 -1.13667969 29.31669922 -1.13867188 28.47167969 C-1.13416016 27.59415039 -1.12964844 26.71662109 -1.125 25.8125 C-1.12306641 24.92079102 -1.12113281 24.02908203 -1.11914062 23.11035156 C-1.06936237 15.37536405 -0.65389449 7.7066136 0 0 Z M18 31 C18.66 31.66 19.32 32.32 20 33 C19.34 33 18.68 33 18 33 C18 32.34 18 31.68 18 31 Z " fill="#E04153" transform="translate(232,81)"/>
<path d="M0 0 C1.03253906 0.01353516 1.03253906 0.01353516 2.0859375 0.02734375 C3.76577838 0.05067487 5.44543746 0.08653674 7.125 0.125 C6.795 1.115 6.465 2.105 6.125 3.125 C5.44695312 3.07859375 4.76890625 3.0321875 4.0703125 2.984375 C-5.23450848 2.62352322 -12.08277324 5.1466329 -19.875 10.125 C-20.7825 10.516875 -21.69 10.90875 -22.625 11.3125 C-30.69707424 15.81423371 -36.408632 22.69810487 -42.02734375 29.90234375 C-43.875 32.125 -43.875 32.125 -45.875 33.125 C-45.545 31.475 -45.215 29.825 -44.875 28.125 C-45.535 27.795 -46.195 27.465 -46.875 27.125 C-46.09125 26.733125 -45.3075 26.34125 -44.5 25.9375 C-41.70316666 24.36364899 -41.70316666 24.36364899 -40.875 21.625 C-39.57105161 18.36512902 -37.85512377 17.83857117 -34.875 16.125 C-34.565625 15.465 -34.25625 14.805 -33.9375 14.125 C-32.35222795 11.1409585 -29.86899633 10.53034521 -26.875 9.125 C-25.03810524 7.62613129 -25.03810524 7.62613129 -23.875 6.125 C-23.875 5.795 -23.875 5.465 -23.875 5.125 C-23.22273438 4.93164062 -22.57046875 4.73828125 -21.8984375 4.5390625 C-21.02445313 4.27867188 -20.15046875 4.01828125 -19.25 3.75 C-18.39148438 3.49476562 -17.53296875 3.23953125 -16.6484375 2.9765625 C-14.7542168 2.39495671 -12.88067316 1.7425666 -11.03125 1.03125 C-7.29989936 -0.04012791 -3.84096473 -0.09676849 0 0 Z " fill="#B7D586" transform="translate(153.875,18.875)"/>
<path d="M0 0 C2.0625 1.625 2.0625 1.625 4 4 C3.75 7.25 3.75 7.25 3 10 C2.01 10.33 1.02 10.66 0 11 C-1.13774309 12.88834985 -1.13774309 12.88834985 -2 15.1875 C-3.14596424 17.95801125 -4.30282698 20.58322234 -5.6875 23.25 C-7.10335007 25.91188108 -7.10335007 25.91188108 -7.5 28.6875 C-8.10039964 31.46434834 -9.02508076 32.02508076 -11 34 C-12.03101947 36.31979381 -13.02936517 38.65429915 -14 41 C-15.62966728 44.33341034 -16.32772187 45.67167812 -19.6875 47.3125 C-20.450625 47.539375 -21.21375 47.76625 -22 48 C-22.33 47.34 -22.66 46.68 -23 46 C-22.34 45.34 -21.68 44.68 -21 44 C-20.855625 43.401875 -20.71125 42.80375 -20.5625 42.1875 C-19.85475567 39.43516093 -18.51114627 37.39264825 -17 35 C-16.67 34.34 -16.34 33.68 -16 33 C-15.01 33 -14.02 33 -13 33 C-13.33 31.68 -13.66 30.36 -14 29 C-12.68 28.67 -11.36 28.34 -10 28 C-10.29185181 27.13036621 -10.29185181 27.13036621 -10.58959961 26.24316406 C-11.07577446 23.58583238 -10.68229282 22.53691771 -9.56640625 20.109375 C-9.24736328 19.40039062 -8.92832031 18.69140625 -8.59960938 17.9609375 C-8.25736328 17.23132813 -7.91511719 16.50171875 -7.5625 15.75 C-7.05493164 14.63238281 -7.05493164 14.63238281 -6.53710938 13.4921875 C-5.70173696 11.65672135 -4.85222033 9.82770445 -4 8 C-3.01 8 -2.02 8 -1 8 C-1.20625 7.4225 -1.4125 6.845 -1.625 6.25 C-2.08661261 3.48032433 -1.42944945 2.35438733 0 0 Z M0 2 C1 4 1 4 1 4 Z M-5 13 C-4 15 -4 15 -4 15 Z M-7 17 C-6 19 -6 19 -6 19 Z M-9 21 C-8 23 -8 23 -8 23 Z " fill="#558143" transform="translate(227,328)"/>
<path d="M0 0 C0.87785156 0.09667969 1.75570313 0.19335938 2.66015625 0.29296875 C4.9375 0.8125 4.9375 0.8125 6.9375 2.8125 C6.628125 3.43125 6.31875 4.05 6 4.6875 C4.74543992 8.37738259 4.6044231 11.72896794 4.4765625 15.60546875 C3.9375 17.8125 3.9375 17.8125 2.06640625 19.18359375 C-0.0625 19.8125 -0.0625 19.8125 -2.75 18.6875 C-5.33932366 16.58804838 -5.49162107 15.9523341 -6.0625 12.8125 C-7.55050372 10.6052642 -7.55050372 10.6052642 -9.0625 8.8125 C-8.4025 8.8125 -7.7425 8.8125 -7.0625 8.8125 C-7.289375 7.884375 -7.51625 6.95625 -7.75 6 C-8.0625 2.8125 -8.0625 2.8125 -6.8984375 1.1015625 C-4.40354604 -0.6501698 -2.98889513 -0.37416213 0 0 Z M2.9375 3.8125 C1.7797494 7.28575181 1.86883348 10.17317448 1.9375 13.8125 C2.2675 13.8125 2.5975 13.8125 2.9375 13.8125 C3.2675 10.5125 3.5975 7.2125 3.9375 3.8125 C3.6075 3.8125 3.2775 3.8125 2.9375 3.8125 Z " fill="#BD1C33" transform="translate(265.0625,124.1875)"/>
<path d="M0 0 C4.5111138 -0.39803945 7.03078899 0.97489234 11 3 C14.2366963 3.70758326 14.2366963 3.70758326 17 4 C17 4.66 17 5.32 17 6 C19.56018518 8.21421421 22.18300938 10.12200625 25 12 C26.35573748 13.31054623 27.68612831 14.64748503 29 16 C31.60220154 18.66566987 33.89507954 20.93005302 37 23 C37.495 24.485 37.495 24.485 38 26 C38.5775 26.28875 39.155 26.5775 39.75 26.875 C42.7813383 28.39066915 44.67142445 30.55499567 47 33 C47.763125 33.763125 48.52625 34.52625 49.3125 35.3125 C49.869375 35.869375 50.42625 36.42625 51 37 C47.23312136 37 46.08809695 36.76462683 43 35 C43 34.01 43 33.02 43 32 C42.21625 31.7525 41.4325 31.505 40.625 31.25 C37.67682892 29.84610901 37.0975223 28.99324263 36 26 C35.34 26 34.68 26 34 26 C32.37890625 24.3203125 32.37890625 24.3203125 30.5625 22.125 C28.41599116 19.53806278 26.83223438 17.88815626 24 16 C24 15.34 24 14.68 24 14 C23.01 14 22.02 14 21 14 C21 13.34 21 12.68 21 12 C20.30003906 11.731875 19.60007813 11.46375 18.87890625 11.1875 C15.81769806 9.92480354 12.89230322 8.49421149 9.9375 7 C8.91527344 6.484375 7.89304688 5.96875 6.83984375 5.4375 C5.90269531 4.963125 4.96554688 4.48875 4 4 C2.66710613 3.33245513 1.33397251 2.66538677 0 2 C0 1.34 0 0.68 0 0 Z " fill="#B1D87E" transform="translate(162,20)"/>
<path d="M0 0 C2.97 0.33 5.94 0.66 9 1 C8.34 1.99 7.68 2.98 7 4 C6.34 4 5.68 4 5 4 C4.67 4.99 4.34 5.98 4 7 C3.29875 7.12375 2.5975 7.2475 1.875 7.375 C-0.99882342 7.91040017 -0.99882342 7.91040017 -3.5625 9.0625 C-8.71249245 10.46704339 -16.0764295 11.46178525 -21 9 C-21 8.34 -21 7.68 -21 7 C-22.65 6.67 -24.3 6.34 -26 6 C-25.01 5.67 -24.02 5.34 -23 5 C-23 4.34 -23 3.68 -23 3 C-22.37955811 3.00523682 -21.75911621 3.01047363 -21.11987305 3.01586914 C-18.30909233 3.03665466 -15.49832779 3.04966517 -12.6875 3.0625 C-11.22280273 3.07506836 -11.22280273 3.07506836 -9.72851562 3.08789062 C-8.79072266 3.09111328 -7.85292969 3.09433594 -6.88671875 3.09765625 C-6.02264404 3.10289307 -5.15856934 3.10812988 -4.26831055 3.11352539 C-1.83271286 3.09335523 -1.83271286 3.09335523 1 2 C0.67 1.34 0.34 0.68 0 0 Z M-20 5 C-20 5.33 -20 5.66 -20 6 C-15.38 6 -10.76 6 -6 6 C-6 5.67 -6 5.34 -6 5 C-10.62 5 -15.24 5 -20 5 Z " fill="#4B6E43" transform="translate(175,405)"/>
<path d="M0 0 C1.32 0.66 2.64 1.32 4 2 C3.566875 2.825 3.13375 3.65 2.6875 4.5 C0.87010601 8.26940976 -0.57250049 12.07252727 -2 16 C-2.52048627 17.3543001 -3.04131568 18.70846838 -3.5625 20.0625 C-6.31006933 27.38455649 -8.0938084 34.92075802 -9.46484375 42.60546875 C-9.62082031 43.45753906 -9.77679688 44.30960938 -9.9375 45.1875 C-10.09089844 46.04730469 -10.24429688 46.90710938 -10.40234375 47.79296875 C-11 50 -11 50 -13 52 C-14.21208751 46.99625414 -13.60253569 43.11482177 -12.25 38.25 C-12.0653418 37.54625244 -11.88068359 36.84250488 -11.69042969 36.11743164 C-10.64707383 32.1886292 -9.48727948 28.30994684 -8.25 24.4375 C-7.02022375 20.51799924 -6.9192386 17.11883148 -7 13 C-6 10.0625 -6 10.0625 -5 8 C-4.34 8 -3.68 8 -3 8 C-2.01 5.36 -1.02 2.72 0 0 Z M-5 11 C-4 13 -4 13 -4 13 Z M-6 14 C-5 16 -5 16 -5 16 Z " fill="#A5D56F" transform="translate(88,85)"/>
<path d="M0 0 C4.8 3.44615385 4.8 3.44615385 5.8125 6.25 C5.874375 6.8275 5.93625 7.405 6 8 C5.38125 8.061875 4.7625 8.12375 4.125 8.1875 C3.42375 8.455625 2.7225 8.72375 2 9 C1.690625 9.804375 1.38125 10.60875 1.0625 11.4375 C0 14 0 14 -2.625 15.3125 C-3.40875 15.539375 -4.1925 15.76625 -5 16 C-4.773125 16.53625 -4.54625 17.0725 -4.3125 17.625 C-3.73164494 22.03949846 -6.63306694 25.4496004 -9 29 C-10.32 29 -11.64 29 -13 29 C-12.6875 26.125 -12.6875 26.125 -12 23 C-11.01 22.34 -10.02 21.68 -9 21 C-8.65876419 19.00133314 -8.3274322 17.00097458 -8 15 C-7.06123445 12.63898449 -6.01768592 10.3501476 -4.9375 8.05078125 C-3.89971945 5.87719712 -3.89971945 5.87719712 -3 3 C-1.4375 1.3125 -1.4375 1.3125 0 0 Z M3 4 C4 6 4 6 4 6 Z M-4 8 C-3 10 -3 10 -3 10 Z M-7 15 C-6 17 -6 17 -6 17 Z M-11 24 C-10 26 -10 26 -10 26 Z " fill="#619147" transform="translate(260,254)"/>
<path d="M0 0 C0.99 0.33 1.98 0.66 3 1 C3 5.29 3 9.58 3 14 C3.66 14.33 4.32 14.66 5 15 C3.68 15.33 2.36 15.66 1 16 C3.64 16 6.28 16 9 16 C8.01 16.66 7.02 17.32 6 18 C6.33 18.66 6.66 19.32 7 20 C5.35 20 3.7 20 2 20 C2 23.96 2 27.92 2 32 C2.66 32 3.32 32 4 32 C4 32.66 4 33.32 4 34 C5.32 34 6.64 34 8 34 C8 34.66 8 35.32 8 36 C9.32 36.33 10.64 36.66 12 37 C7.89208635 38.54046762 4.21433421 37.75996191 0 37 C-1.13495465 34.73009069 -1.12893026 33.47633001 -1.1328125 30.95703125 C-1.13474609 30.13686523 -1.13667969 29.31669922 -1.13867188 28.47167969 C-1.13416016 27.59415039 -1.12964844 26.71662109 -1.125 25.8125 C-1.12306641 24.92079102 -1.12113281 24.02908203 -1.11914062 23.11035156 C-1.06936237 15.37536405 -0.65389449 7.7066136 0 0 Z " fill="#A86254" transform="translate(232,81)"/>
<path d="M0 0 C0.33 0 0.66 0 1 0 C1.12377604 5.74739758 1.21442248 11.49401627 1.2746582 17.24243164 C1.29977281 19.19699623 1.33387131 21.15146717 1.37719727 23.10571289 C1.43798434 25.91836668 1.46623983 28.72977702 1.48828125 31.54296875 C1.51408768 32.41398727 1.5398941 33.2850058 1.56648254 34.18241882 C1.56851593 38.60005364 1.47117804 40.40316144 -1.35083008 43.9777832 C-6.50559601 47.91262112 -10.41161666 49.74585472 -17 49 C-18.70703125 47.4765625 -18.70703125 47.4765625 -20 46 C-19.22914063 45.87882812 -18.45828125 45.75765625 -17.6640625 45.6328125 C-16.15972656 45.38144531 -16.15972656 45.38144531 -14.625 45.125 C-13.12839844 44.88136719 -13.12839844 44.88136719 -11.6015625 44.6328125 C-8.8574885 44.2041198 -8.8574885 44.2041198 -7 42 C-5.68 42 -4.36 42 -3 42 C-2.73067479 37.34947128 -2.73067479 37.34947128 -4 33 C-3.5625 30.875 -3.5625 30.875 -3 29 C-2.34 29 -1.68 29 -1 29 C-1.66 28.34 -2.32 27.68 -3 27 C-3 26.01 -3 25.02 -3 24 C-2.34 24 -1.68 24 -1 24 C-0.67 16.08 -0.34 8.16 0 0 Z " fill="#A3CF75" transform="translate(231,80)"/>
<path d="M0 0 C0.99 0.33 1.98 0.66 3 1 C4.1875 3.5625 4.1875 3.5625 5 6 C6.65 6 8.3 6 10 6 C10 6.99 10 7.98 10 9 C10.33 9.99 10.66 10.98 11 12 C11.66 12 12.32 12 13 12 C13.4125 12.45375 13.825 12.9075 14.25 13.375 C15.99741394 15.22867807 15.99741394 15.22867807 18.9375 15.9375 C22.27345151 17.09487093 23.79217918 18.28268207 26 21 C26 21.66 26 22.32 26 23 C16.73111782 21.31654918 16.73111782 21.31654918 13 18 C12.0409375 17.566875 12.0409375 17.566875 11.0625 17.125 C8.19142558 15.55895941 6.24121288 13.35917146 4 11 C3.34 10.34 2.68 9.68 2 9 C-0.29013653 5.5647952 -0.17842973 4.014669 0 0 Z " fill="#519A49" transform="translate(118,450)"/>
<path d="M0 0 C3.96 0.33 7.92 0.66 12 1 C11.34 1.66 10.68 2.32 10 3 C6.875 2.625 6.875 2.625 4 2 C4 2.66 4 3.32 4 4 C2.68 4.33 1.36 4.66 0 5 C0.33 5.66 0.66 6.32 1 7 C-8.57 7 -18.14 7 -28 7 C-27.67 6.34 -27.34 5.68 -27 5 C-28.32 4.67 -29.64 4.34 -31 4 C-31 3.34 -31 2.68 -31 2 C-21.1 2 -11.2 2 -1 2 C-0.67 1.34 -0.34 0.68 0 0 Z " fill="#73814D" transform="translate(395,384)"/>
<path d="M0 0 C3.00198845 3.00198845 3.95992537 4.95805953 4.125 9.25 C4.08375 10.1575 4.0425 11.065 4 12 C4.99 11.34 5.98 10.68 7 10 C6.979375 11.19625 6.95875 12.3925 6.9375 13.625 C6.93117429 17.18004869 7.30111125 20.50555624 8 24 C8.66 24 9.32 24 10 24 C9.67 25.32 9.34 26.64 9 28 C7.02 27.67 5.04 27.34 3 27 C3.33 26.01 3.66 25.02 4 24 C3.46805397 21.45981734 3.46805397 21.45981734 2.5625 18.8125 C2.27503906 17.91144531 1.98757812 17.01039063 1.69140625 16.08203125 C1.46324219 15.39496094 1.23507813 14.70789063 1 14 C0.34 14 -0.32 14 -1 14 C-1.16852247 12.39602723 -1.33474886 10.7918131 -1.5 9.1875 C-1.5928125 8.29417969 -1.685625 7.40085937 -1.78125 6.48046875 C-2 4 -2 4 -2 1 C-1.34 0.67 -0.68 0.34 0 0 Z M-1 6 C0 8 0 8 0 8 Z " fill="#64A74A" transform="translate(73,349)"/>
<path d="M0 0 C0.99 0.33 1.98 0.66 3 1 C2 4 2 4 0.4375 6 C-1.29181802 7.99550643 -1.29181802 7.99550643 -1 11 C-1.66 11 -2.32 11 -3 11 C-2.76410156 11.52078125 -2.52820313 12.0415625 -2.28515625 12.578125 C-1.85637831 16.21980067 -3.66097972 18.70549255 -5.4375 21.75 C-5.77587891 22.35199219 -6.11425781 22.95398438 -6.46289062 23.57421875 C-7.29768265 25.05568065 -8.14741494 26.52870608 -9 28 C-9.66 28 -10.32 28 -11 28 C-11.33 28.66 -11.66 29.32 -12 30 C-12.66 30 -13.32 30 -14 30 C-13.76802509 28.01164364 -13.53249448 26.02355834 -13.26953125 24.0390625 C-13.07538815 22.57032772 -12.90509161 21.09837028 -12.75 19.625 C-12.5025 19.08875 -12.255 18.5525 -12 18 C-11.195625 17.731875 -10.39125 17.46375 -9.5625 17.1875 C-8.716875 16.795625 -7.87125 16.40375 -7 16 C-5.62032476 12.46485707 -5.62032476 12.46485707 -5 9 C-4.34 9 -3.68 9 -3 9 C-2.87625 8.071875 -2.7525 7.14375 -2.625 6.1875 C-2 3 -2 3 0 0 Z " fill="#4B8640" transform="translate(246,389)"/>
<path d="M0 0 C-0.51949219 0.44730469 -1.03898437 0.89460938 -1.57421875 1.35546875 C-8.96498572 7.76262163 -15.49534814 14.70175227 -22 22 C-22.33 21.34 -22.66 20.68 -23 20 C-22.67 19.01 -22.34 18.02 -22 17 C-22.66 16.67 -23.32 16.34 -24 16 C-23.21625 15.608125 -22.4325 15.21625 -21.625 14.8125 C-18.82816666 13.23864899 -18.82816666 13.23864899 -18 10.5 C-16.69605161 7.24012902 -14.98012377 6.71357117 -12 5 C-11.566875 3.9790625 -11.566875 3.9790625 -11.125 2.9375 C-10 1 -10 1 -6.5625 -0.3125 C-3 -1 -3 -1 0 0 Z " fill="#ACD175" transform="translate(131,30)"/>
<path d="M0 0 C7.60344828 0.60344828 7.60344828 0.60344828 10 3 C10.99 3 11.98 3 13 3 C13 4.65 13 6.3 13 8 C10.69 8 8.38 8 6 8 C5.67 8.66 5.34 9.32 5 10 C5 9.34 5 8.68 5 8 C2.69 7.67 0.38 7.34 -2 7 C-1.125 1.125 -1.125 1.125 0 0 Z " fill="#CA2A3D" transform="translate(259,117)"/>
<path d="M0 0 C1.1875 1.5625 1.1875 1.5625 2 4 C0.1309541 9.71097359 -2.74316082 13.74316082 -7 18 C-9.0371963 20.54649538 -10.6266516 23.04201882 -12 26 C-13.65 25.67 -15.3 25.34 -17 25 C-16 23 -16 23 -13.6875 20.8125 C-10.14755316 17.10790447 -7 13.32317063 -7 8 C-5.35 7.34 -3.7 6.68 -2 6 C-2 4.68 -2 3.36 -2 2 C-1.34 2 -0.68 2 0 2 C0 1.34 0 0.68 0 0 Z M-3 9 C-3.33 9.66 -3.66 10.32 -4 11 C-3.34 11 -2.68 11 -2 11 C-2.33 10.34 -2.66 9.68 -3 9 Z M-5 12 C-4 14 -4 14 -4 14 Z " fill="#44803B" transform="translate(230,420)"/>
<path d="M0 0 C1.30138849 2.60277697 1.4217343 4.11814893 1 7 C-1.375 8.5625 -1.375 8.5625 -4 10 C-4.268125 10.680625 -4.53625 11.36125 -4.8125 12.0625 C-6.34435647 14.56184476 -7.33592375 14.56127889 -10.125 15.25 C-11.40375 15.4975 -12.6825 15.745 -14 16 C-13.66142425 12.95281822 -13.16892978 11.2252397 -11.3125 8.75 C-8.53405058 6.64738963 -6.43246436 6.31204221 -3 6 C-2.87625 5.195625 -2.7525 4.39125 -2.625 3.5625 C-2.41875 2.716875 -2.2125 1.87125 -2 1 C-1.34 0.67 -0.68 0.34 0 0 Z " fill="#6A9661" transform="translate(212,446)"/>
<path d="M0 0 C0.268125 0.639375 0.53625 1.27875 0.8125 1.9375 C1.88667752 4.33131686 1.88667752 4.33131686 5 5 C5.99 6.485 5.99 6.485 7 8 C10.8088684 7.32784675 14.41388869 6.46704554 18 5 C18.33 4.01 18.66 3.02 19 2 C19.66 2 20.32 2 21 2 C20.71984352 5.36187774 20.22366109 6.76318238 17.875 9.25 C13.65622224 11.81795168 10.09396237 12.42831048 5.25 11.4375 C2.14831791 9.45586978 1.29258294 7.40153404 0 4 C0 2.68 0 1.36 0 0 Z " fill="#ABDA73" transform="translate(163,72)"/>
<path d="M0 0 C0.2475 0.9075 0.495 1.815 0.75 2.75 C2.05597362 6.14553141 3.30077215 7.63817563 6 10 C12 16 12 16 13 18 C12.34 18.99 11.68 19.98 11 21 C10.67 20.01 10.34 19.02 10 18 C9.278125 17.773125 8.55625 17.54625 7.8125 17.3125 C4.10126968 15.58059252 2.67036789 13.12625254 0.4296875 9.77734375 C-0.96968509 7.70954725 -0.96968509 7.70954725 -4 7 C-3.814375 6.38125 -3.62875 5.7625 -3.4375 5.125 C-2.76313824 2.95839822 -2.76313824 2.95839822 -4 1 C-1 0 -1 0 0 0 Z " fill="#538645" transform="translate(129,384)"/>
<path d="M0 0 C0 0.66 0 1.32 0 2 C-0.95712891 2.19916016 -0.95712891 2.19916016 -1.93359375 2.40234375 C-3.17302734 2.66724609 -3.17302734 2.66724609 -4.4375 2.9375 C-5.26121094 3.11152344 -6.08492188 3.28554687 -6.93359375 3.46484375 C-8.97661204 3.80752994 -8.97661204 3.80752994 -10 5 C-11.90899657 5.37477233 -13.8278409 5.69995565 -15.75 6 C-19.51905796 6.59413722 -23.26361693 7.22504647 -27 8 C-22.43006088 2.69887062 -16.94468453 0.79020886 -10.06640625 0.1171875 C-6.70345871 -0.07352786 -3.36773322 -0.06013809 0 0 Z " fill="#97A967" transform="translate(389,95)"/>
<path d="M0 0 C3.256427 3.256427 2.75119896 7.26594101 3.046875 11.7109375 C2.98645386 15.95048757 2.10889729 18.37269667 0 22 C-0.99 22 -1.98 22 -3 22 C-2.67 15.07 -2.34 8.14 -2 1 C-1.34 0.67 -0.68 0.34 0 0 Z M-1 18 C0 20 0 20 0 20 Z " fill="#5E8A45" transform="translate(280,299)"/>
<path d="M0 0 C0.99 0 1.98 0 3 0 C3.33 0.66 3.66 1.32 4 2 C6.02463255 2.65213292 6.02463255 2.65213292 8 3 C8 3.66 8 4.32 8 5 C9.32 5.33 10.64 5.66 12 6 C12 6.66 12 7.32 12 8 C14.97 8.495 14.97 8.495 18 9 C18.33 8.34 18.66 7.68 19 7 C19 8.32 19 9.64 19 11 C19.99 11.66 20.98 12.32 22 13 C18.81901772 14.06032743 17.63466272 13.9708943 14.4375 13.3125 C13.65246094 13.16425781 12.86742187 13.01601562 12.05859375 12.86328125 C9.38615744 11.74258215 9.17278493 10.57818837 8 8 C6.3299641 6.58236619 6.3299641 6.58236619 4.4375 5.4375 C1.10896309 3.32688928 1.10896309 3.32688928 0 0 Z " fill="#9FCB7E" transform="translate(133,119)"/>
<path d="M0 0 C0 0.66 0 1.32 0 2 C0.66 2 1.32 2 2 2 C2 2.66 2 3.32 2 4 C-5.26 4 -12.52 4 -20 4 C-20 2.68 -20 1.36 -20 0 C-6 -2 -6 -2 0 0 Z M-17 2 C-17 2.33 -17 2.66 -17 3 C-11.72 3 -6.44 3 -1 3 C-6.50211216 0.24894392 -11.10119821 0.56998744 -17 2 Z " fill="#758153" transform="translate(394,162)"/>
<path d="M0 0 C4.32635658 4.18214469 6.16181936 7.01299541 7 13 C7.32635698 14.66804677 7.65725594 16.33524314 8 18 C6.68 18 5.36 18 4 18 C3.35242375 16.56328432 2.70700547 15.12559584 2.0625 13.6875 C1.70285156 12.88699219 1.34320313 12.08648437 0.97265625 11.26171875 C-0.31428674 8.26918866 -1.48050347 5.22087851 -2 2 C-1.34 1.34 -0.68 0.68 0 0 Z M5 15 C6 17 6 17 6 17 Z " fill="#457A39" transform="translate(89,403)"/>
<path d="M0 0 C0.66 0.66 1.32 1.32 2 2 C1.01923848 4.18785263 0.29151474 5.75512761 -1.5625 7.3125 C-3.77817401 9.91350862 -3.6872065 12.6843889 -4 16 C-5.32 16 -6.64 16 -8 16 C-9.10844919 12.67465243 -8.84454356 10.37817425 -8 7 C-7.01 7 -6.02 7 -5 7 C-5.33 6.01 -5.66 5.02 -6 4 C-5.34 3.34 -4.68 2.68 -4 2 C-1.875 2.375 -1.875 2.375 0 3 C0 2.01 0 1.02 0 0 Z " fill="#4E8A3D" transform="translate(206,377)"/>
<path d="M0 0 C3.96 0.33 7.92 0.66 12 1 C11.34 1.66 10.68 2.32 10 3 C6.875 2.625 6.875 2.625 4 2 C4 2.66 4 3.32 4 4 C2.68 4.33 1.36 4.66 0 5 C0.33 5.66 0.66 6.32 1 7 C-2.63 7 -6.26 7 -10 7 C-10.33 5.68 -10.66 4.36 -11 3 C-10.28972656 2.95101563 -9.57945312 2.90203125 -8.84765625 2.8515625 C-7.46900391 2.73941406 -7.46900391 2.73941406 -6.0625 2.625 C-5.14597656 2.55539062 -4.22945313 2.48578125 -3.28515625 2.4140625 C-2.15400391 2.20910156 -2.15400391 2.20910156 -1 2 C-0.67 1.34 -0.34 0.68 0 0 Z " fill="#5E693E" transform="translate(395,384)"/>
<path d="M0 0 C1.32 0.99 2.64 1.98 4 3 C1.10933941 12.59453303 1.10933941 12.59453303 -2 16 C-2.66 15.67 -3.32 15.34 -4 15 C-4 11.37 -4 7.74 -4 4 C-3.01 3.67 -2.02 3.34 -1 3 C-0.67 2.01 -0.34 1.02 0 0 Z M-1 9 C0 11 0 11 0 11 Z M-2 12 C-1 14 -1 14 -1 14 Z " fill="#4D7E3C" transform="translate(263,347)"/>
<path d="M0 0 C1.0625 1.75 1.0625 1.75 2 4 C1.79375 4.639375 1.5875 5.27875 1.375 5.9375 C0.70799883 8.24188224 0.70799883 8.24188224 2.8125 10.6875 C4.78157965 13.03347649 4.78157965 13.03347649 7 14 C6.67 15.65 6.34 17.3 6 19 C3.525 18.01 3.525 18.01 1 17 C1 16.34 1 15.68 1 15 C0.34 14.67 -0.32 14.34 -1 14 C-1.5625 11.75 -1.5625 11.75 -2 9 C-2.185625 8.071875 -2.37125 7.14375 -2.5625 6.1875 C-2.706875 5.465625 -2.85125 4.74375 -3 4 C-2.34 4 -1.68 4 -1 4 C-0.67 2.68 -0.34 1.36 0 0 Z " fill="#4A913F" transform="translate(100,418)"/>
<path d="M0 0 C1.32 0.66 2.64 1.32 4 2 C3.54625 2.845625 3.0925 3.69125 2.625 4.5625 C0.97141586 8.06046645 -0.03009521 11.26959695 -1 15 C-2.98 15.33 -4.96 15.66 -7 16 C-6.26199535 11.44897135 -4.55399054 8.83098582 -2 5 C-1.30686092 3.34416775 -0.63525576 1.67889021 0 0 Z M-5 11 C-4 13 -4 13 -4 13 Z " fill="#84A360" transform="translate(88,85)"/>
<path d="M0 0 C0.87462891 0.05671875 1.74925781 0.1134375 2.65039062 0.171875 C4.78849869 0.31207881 6.92563113 0.46702967 9.0625 0.625 C5.09217736 2.79073062 1.25711415 3.27848441 -3.1875 3.75 C-3.91324219 3.83636719 -4.63898438 3.92273438 -5.38671875 4.01171875 C-10.2646869 4.55951196 -15.02979779 4.70272379 -19.9375 4.625 C-15.15583636 -1.5630353 -6.94025456 -0.52777601 0 0 Z " fill="#B4D87E" transform="translate(202.9375,128.375)"/>
<path d="M0 0 C0.33 0 0.66 0 1 0 C1.1637024 12.69603076 0.65910557 25.32273538 0 38 C-1.32 37.01 -2.64 36.02 -4 35 C-3.505 32.03 -3.505 32.03 -3 29 C-2.34 29 -1.68 29 -1 29 C-1.66 28.34 -2.32 27.68 -3 27 C-3 26.01 -3 25.02 -3 24 C-2.34 24 -1.68 24 -1 24 C-0.67 16.08 -0.34 8.16 0 0 Z " fill="#A7D663" transform="translate(231,80)"/>
<path d="M0 0 C0.99 0 1.98 0 3 0 C3.7013076 6.59229145 1.49602186 10.49376557 -2 16 C-3.32 16 -4.64 16 -6 16 C-4.25192871 10.53262809 -2.34205919 5.24175152 0 0 Z M-1 5 C0 7 0 7 0 7 Z M-3 9 C-2 11 -2 11 -2 11 Z " fill="#708850" transform="translate(93,69)"/>
<path d="M0 0 C1.42020201 0.22906484 2.83845901 0.47251758 4.25 0.75 C4.25 1.41 4.25 2.07 4.25 2.75 C7.55 2.42 10.85 2.09 14.25 1.75 C14.58 3.07 14.91 4.39 15.25 5.75 C13.20809019 5.60761163 11.16647955 5.46092972 9.125 5.3125 C7.98804688 5.23128906 6.85109375 5.15007812 5.6796875 5.06640625 C2.49540875 4.77264022 -0.59969158 4.28698439 -3.75 3.75 C-5.41627298 3.71377667 -7.08405374 3.70100158 -8.75 3.75 C-6.12072175 -0.02244271 -4.38091087 -0.51743042 0 0 Z " fill="#4A8345" transform="translate(149.75,473.25)"/>
<path d="M0 0 C1.98 0.99 1.98 0.99 4 2 C4 2.66 4 3.32 4 4 C4.66 4 5.32 4 6 4 C10.57142857 11.28571429 10.57142857 11.28571429 10 16 C9.67 15.34 9.34 14.68 9 14 C8.34 14 7.68 14 7 14 C6.67 13.34 6.34 12.68 6 12 C5.01 11.34 4.02 10.68 3 10 C3 9.34 3 8.68 3 8 C2.01 7.67 1.02 7.34 0 7 C0 4.69 0 2.38 0 0 Z " fill="#4E9443" transform="translate(107,438)"/>
<path d="M0 0 C0.99 0.33 1.98 0.66 3 1 C2 4 2 4 0.4375 6 C-1.29181802 7.99550643 -1.29181802 7.99550643 -1 11 C-1.66 11 -2.32 11 -3 11 C-2.7525 11.556875 -2.505 12.11375 -2.25 12.6875 C-2 15 -2 15 -3.9375 17.75 C-4.618125 18.4925 -5.29875 19.235 -6 20 C-6.33 19.67 -6.66 19.34 -7 19 C-6.61140641 15.50265772 -6.11403913 12.34211739 -5 9 C-4.34 9 -3.68 9 -3 9 C-2.87625 8.071875 -2.7525 7.14375 -2.625 6.1875 C-2 3 -2 3 0 0 Z " fill="#5A8E4D" transform="translate(246,389)"/>
<path d="M0 0 C0.75925781 0.08378906 1.51851562 0.16757812 2.30078125 0.25390625 C3.29464844 0.35574219 4.28851563 0.45757812 5.3125 0.5625 C6.29863281 0.66691406 7.28476563 0.77132813 8.30078125 0.87890625 C11.09930347 1.16602527 11.09930347 1.16602527 14 0 C14 0.66 14 1.32 14 2 C14.99 2.66 15.98 3.32 17 4 C15.01432292 3.96744792 13.02864583 3.93489583 11.04296875 3.90234375 C8.79694539 3.91736783 8.79694539 3.91736783 6 5 C3.66700175 5.03954234 1.33291811 5.04401732 -1 5 C-1 2 -1 2 0 0 Z " fill="#43883E" transform="translate(167,473)"/>
<path d="M0 0 C0.33 0.66 0.66 1.32 1 2 C1.99 1.67 2.98 1.34 4 1 C3.67 2.65 3.34 4.3 3 6 C2.01 6 1.02 6 0 6 C0.309375 6.928125 0.309375 6.928125 0.625 7.875 C0.74875 8.57625 0.8725 9.2775 1 10 C0.34 10.66 -0.32 11.32 -1 12 C-1.64767793 14.57061311 -1.64767793 14.57061311 -2 17 C-4 16 -4 16 -4.77734375 13.80078125 C-5.05948605 10.25172813 -4.12979068 8.36030796 -2.5625 5.1875 C-2.08941406 4.21167969 -1.61632812 3.23585938 -1.12890625 2.23046875 C-0.75636719 1.49441406 -0.38382813 0.75835937 0 0 Z M1 3 C2 5 2 5 2 5 Z " fill="#426B36" transform="translate(254,370)"/>
<path d="M0 0 C0.33 0 0.66 0 1 0 C0.93941406 0.77601563 0.87882812 1.55203125 0.81640625 2.3515625 C0.73261719 3.43179688 0.64882812 4.51203125 0.5625 5.625 C0.4696875 6.80449219 0.376875 7.98398438 0.28125 9.19921875 C0.09462423 11.72125868 -0.07223961 14.24484329 -0.21875 16.76953125 C-0.2909375 17.97996094 -0.363125 19.19039062 -0.4375 20.4375 C-0.49808594 21.54996094 -0.55867188 22.66242188 -0.62109375 23.80859375 C-1.01165669 27.09818058 -1.84619758 29.9029514 -3 33 C-3.33 33 -3.66 33 -4 33 C-4.24933861 25.58996829 -3.30000049 18.7236514 -2 11.4375 C-1.80921875 10.33341797 -1.6184375 9.22933594 -1.421875 8.09179688 C-0.95460111 5.39329016 -0.48051278 2.6961751 0 0 Z " fill="#A0CB71" transform="translate(68,167)"/>
<path d="M0 0 C1.20398438 0.08378906 2.40796875 0.16757813 3.6484375 0.25390625 C5.22393916 0.3570641 6.79946109 0.45991266 8.375 0.5625 C9.1690625 0.61857422 9.963125 0.67464844 10.78125 0.73242188 C15.01590885 1.15352804 15.01590885 1.15352804 19 0 C19 1.32 19 2.64 19 4 C13.06 4.33 7.12 4.66 1 5 C1.33 4.34 1.66 3.68 2 3 C1.34 2.67 0.68 2.34 0 2 C0 1.34 0 0.68 0 0 Z " fill="#81A25E" transform="translate(156,133)"/>
<path d="M0 0 C1.65 0.33 3.3 0.66 5 1 C5 1.66 5 2.32 5 3 C4.01 3 3.02 3 2 3 C1.67 4.98 1.34 6.96 1 9 C0.01 9.33 -0.98 9.66 -2 10 C-2.165 10.66 -2.33 11.32 -2.5 12 C-2.665 12.66 -2.83 13.32 -3 14 C-3.99 14.33 -4.98 14.66 -6 15 C-5.67 13.02 -5.34 11.04 -5 9 C-4.34 9 -3.68 9 -3 9 C-2.87625 8.2575 -2.7525 7.515 -2.625 6.75 C-2.04513299 4.19858515 -1.26291261 2.2732427 0 0 Z " fill="#94C168" transform="translate(127,116)"/>
<path d="M0 0 C1.44010481 0.25662245 2.8770687 0.53090821 4.3125 0.8125 C5.11300781 0.96332031 5.91351563 1.11414063 6.73828125 1.26953125 C9.2691219 2.08691847 10.22624254 3.07463934 12 5 C12.86625 5.33 13.7325 5.66 14.625 6 C15.800625 6.495 15.800625 6.495 17 7 C17.33 7.99 17.66 8.98 18 10 C9.83746736 9.33093995 9.83746736 9.33093995 7 6 C4.71643645 4.56373152 2.36834589 3.29588737 0 2 C0 1.34 0 0.68 0 0 Z " fill="#B3DA81" transform="translate(163,64)"/>
<path d="M0 0 C3 2 3 2 3.73046875 3.953125 C4.60984856 8.37257226 5.23254488 12.46537479 5 17 C4.34 17 3.68 17 3 17 C3 16.34 3 15.68 3 15 C2.34 15 1.68 15 1 15 C0.15318867 9.91913204 -0.09038099 5.15171623 0 0 Z " fill="#6DAA4F" transform="translate(102,321)"/>
<path d="M0 0 C2 1 2 1 2.9375 3.5 C3.288125 4.655 3.63875 5.81 4 7 C4.53769195 8.62631951 5.07949325 10.25128507 5.625 11.875 C6.3125 13.9375 6.3125 13.9375 7 16 C5.35 16.33 3.7 16.66 2 17 C1.46585888 15.10787298 0.94821671 13.21108364 0.4375 11.3125 C0.14746094 10.25675781 -0.14257812 9.20101562 -0.44140625 8.11328125 C-1.00124767 4.99304618 -0.84690764 3.02306766 0 0 Z M0 2 C1 4 1 4 1 4 Z M3 10 C4 12 4 12 4 12 Z M4 12 C5 14 5 14 5 14 Z " fill="#4B5534" transform="translate(267,166)"/>
<path d="M0 0 C0.33 0.66 0.66 1.32 1 2 C-0.328125 4.64453125 -0.328125 4.64453125 -2.25 7.8125 C-2.87390625 8.85019531 -3.4978125 9.88789063 -4.140625 10.95703125 C-4.75421875 11.96121094 -5.3678125 12.96539062 -6 14 C-7.00099445 15.66606959 -8.00136014 17.33251801 -9 19 C-9.99 18.67 -10.98 18.34 -12 18 C-11.34 16.35 -10.68 14.7 -10 13 C-9.34 13 -8.68 13 -8 13 C-7.9175 12.278125 -7.835 11.55625 -7.75 10.8125 C-6.52872359 6.23271345 -3.37398411 3.20528491 0 0 Z " fill="#59633D" transform="translate(309,158)"/>
<path d="M0 0 C0.99 0.33 1.98 0.66 3 1 C3 1.33 3 1.66 3 2 C3.95712891 2.16435547 3.95712891 2.16435547 4.93359375 2.33203125 C5.75988281 2.49058594 6.58617187 2.64914062 7.4375 2.8125 C8.67306641 3.03873047 8.67306641 3.03873047 9.93359375 3.26953125 C10.95646484 3.63111328 10.95646484 3.63111328 12 4 C12.33 4.99 12.66 5.98 13 7 C11.54176788 7.0270043 10.08339325 7.04639787 8.625 7.0625 C7.81289062 7.07410156 7.00078125 7.08570313 6.1640625 7.09765625 C4 7 4 7 2 6 C2 5.34 2 4.68 2 4 C0.35 3.67 -1.3 3.34 -3 3 C-2.01 2.67 -1.02 2.34 0 2 C0 1.34 0 0.68 0 0 Z " fill="#629856" transform="translate(152,408)"/>
<path d="M0 0 C2.0625 1.625 2.0625 1.625 4 4 C3.75 7.25 3.75 7.25 3 10 C2.01 10.33 1.02 10.66 0 11 C-0.99 12.485 -0.99 12.485 -2 14 C-2.66 12.02 -3.32 10.04 -4 8 C-3.01 8 -2.02 8 -1 8 C-1.20625 7.4225 -1.4125 6.845 -1.625 6.25 C-2.08661261 3.48032433 -1.42944945 2.35438733 0 0 Z M0 2 C1 4 1 4 1 4 Z " fill="#599C3F" transform="translate(227,328)"/>
<path d="M0 0 C0.99 0 1.98 0 3 0 C3.67081836 6.43985624 1.75430238 9.83783423 -2 15 C-2.99 14.67 -3.98 14.34 -5 14 C-4.34580901 8.93001981 -2.1453591 4.58009223 0 0 Z M0 3 C1 5 1 5 1 5 Z M-2 7 C-1 9 -1 9 -1 9 Z M-4 11 C-3 13 -3 13 -3 13 Z " fill="#466C39" transform="translate(222,338)"/>
<path d="M0 0 C0.69738281 0.00451172 1.39476562 0.00902344 2.11328125 0.01367188 C3.82555803 0.0253998 5.53779033 0.04333347 7.25 0.0625 C6.92 1.0525 6.59 2.0425 6.25 3.0625 C5.57195312 3.05089844 4.89390625 3.03929687 4.1953125 3.02734375 C-2.19204207 2.96541649 -8.40969676 3.29231132 -14.75 4.0625 C-10.61377511 -0.69415863 -5.95265236 -0.07314223 0 0 Z " fill="#C4E892" transform="translate(153.75,18.9375)"/>
<path d="M0 0 C2.97 0.33 5.94 0.66 9 1 C8.01 2.485 8.01 2.485 7 4 C6.34 4 5.68 4 5 4 C4.67 4.99 4.34 5.98 4 7 C3.2575 7.144375 2.515 7.28875 1.75 7.4375 C-0.52027739 7.90187492 -2.75759479 8.41863569 -5 9 C-5 8.01 -5 7.02 -5 6 C-2.36 5.34 0.28 4.68 3 4 C3 3.01 3 2.02 3 1 C2.01 0.67 1.02 0.34 0 0 Z " fill="#569A41" transform="translate(175,405)"/>
<path d="M0 0 C0.33 0 0.66 0 1 0 C1.66 2.97 2.32 5.94 3 9 C3.66 9 4.32 9 5 9 C5.33 9.99 5.66 10.98 6 12 C4.68 12.99 3.36 13.98 2 15 C1.67 14.01 1.34 13.02 1 12 C0.484375 11.525625 -0.03125 11.05125 -0.5625 10.5625 C-2 9 -2 9 -2 5 C-1.38655243 3.31301918 -0.72904086 1.64034193 0 0 Z " fill="#4F8C3F" transform="translate(83,383)"/>
<path d="M0 0 C0.33 0.99 0.66 1.98 1 3 C-1.01822917 2.96744792 -3.03645833 2.93489583 -5.0546875 2.90234375 C-7.08185404 2.87350758 -7.08185404 2.87350758 -9 4 C-8.67 4.66 -8.34 5.32 -8 6 C-13.75 6.125 -13.75 6.125 -16 5 C-16 4.01 -16 3.02 -16 2 C-14.27192682 1.66104344 -12.54248026 1.32908475 -10.8125 1 C-9.84957031 0.814375 -8.88664063 0.62875 -7.89453125 0.4375 C-5.2065794 0.03122388 -2.71228981 -0.07933572 0 0 Z " fill="#79995E" transform="translate(191,132)"/>
<path d="M0 0 C3.63 0.33 7.26 0.66 11 1 C10.67 1.66 10.34 2.32 10 3 C11.32 4.32 12.64 5.64 14 7 C9.71 6.01 5.42 5.02 1 4 C0.67 2.68 0.34 1.36 0 0 Z " fill="#899F5F" transform="translate(393,96)"/>
<path d="M0 0 C2.4375 0.625 2.4375 0.625 5 2 C5.8125 5.125 5.8125 5.125 6 8 C6.66 8 7.32 8 8 8 C8.33 10.64 8.66 13.28 9 16 C8.01 15.67 7.02 15.34 6 15 C5.67 13.02 5.34 11.04 5 9 C4.01 8.67 3.02 8.34 2 8 C2 6.35 2 4.7 2 3 C1.34 3 0.68 3 0 3 C0 2.01 0 1.02 0 0 Z M6 10 C7 12 7 12 7 12 Z " fill="#748D57" transform="translate(225,65)"/>
<path d="M0 0 C0.8353125 0.99 0.8353125 0.99 1.6875 2 C3.84062308 4.25492211 3.84062308 4.25492211 6.75 4.25 C7.4925 4.1675 8.235 4.085 9 4 C6.64046906 6.35953094 5.22104383 6.49141413 2 7 C2.33 7.66 2.66 8.32 3 9 C1.02 9.33 -0.96 9.66 -3 10 C-2.49287967 6.28111761 -1.88391785 3.26545761 0 0 Z " fill="#40773A" transform="translate(192,461)"/>
<path d="M0 0 C0.99 0 1.98 0 3 0 C3.33 2.31 3.66 4.62 4 7 C4.66 7 5.32 7 6 7 C6.33 8.32 6.66 9.64 7 11 C6.34 11 5.68 11 5 11 C4.67 12.98 4.34 14.96 4 17 C1.01708988 11.88643979 -0.36844835 5.89517358 0 0 Z M1 1 C2 4 2 4 2 4 Z M2 4 C3 7 3 7 3 7 Z M3 8 C3 9.65 3 11.3 3 13 C3.33 13 3.66 13 4 13 C4 11.35 4 9.7 4 8 C3.67 8 3.34 8 3 8 Z " fill="#485A2E" transform="translate(251,191)"/>
<path d="M0 0 C1 2 2 4 3 6 C2.34 6.66 1.68 7.32 1 8 C0.34 7.34 -0.32 6.68 -1 6 C-1.99 6 -2.98 6 -4 6 C-4 5.34 -4 4.68 -4 4 C-5.32 4 -6.64 4 -8 4 C-8 3.01 -8 2.02 -8 1 C-5.29120665 -0.35439668 -2.99066732 -0.06501451 0 0 Z " fill="#913344" transform="translate(271,114)"/>
<path d="M0 0 C0.78375 0.04125 1.5675 0.0825 2.375 0.125 C1.14421451 5.04814194 -0.31240225 7.39018192 -4.625 10.125 C-5.615 10.125 -6.605 10.125 -7.625 10.125 C-7.315625 9.5475 -7.00625 8.97 -6.6875 8.375 C-5.56462332 6.19968431 -5.56462332 6.19968431 -5.125 4 C-4.28448493 0.84806848 -3.20491885 0.15261518 0 0 Z " fill="#4B763A" transform="translate(211.625,365.875)"/>
<path d="M0 0 C0.66 0.33 1.32 0.66 2 1 C1.67515625 1.81404297 1.67515625 1.81404297 1.34375 2.64453125 C1.0653125 3.35996094 0.786875 4.07539063 0.5 4.8125 C0.2215625 5.52019531 -0.056875 6.22789062 -0.34375 6.95703125 C-1.1529162 9.11841216 -1.1529162 9.11841216 -1 12 C-0.34 12 0.32 12 1 12 C1 12.66 1 13.32 1 14 C-1.5614657 16.29648649 -2.47967572 17 -6 17 C-5.49487476 10.77012202 -2.67395877 5.54525767 0 0 Z " fill="#305023" transform="translate(238,301)"/>
<path d="M0 0 C0.33 0 0.66 0 1 0 C1.70199948 12.67893206 2.14978835 25.30127632 2 38 C1.67 38 1.34 38 1 38 C-0.24795354 25.34218554 -0.10177436 12.70457176 0 0 Z " fill="#000000" transform="translate(60,262)"/>
<path d="M0 0 C0.99 0 1.98 0 3 0 C3.33 0.66 3.66 1.32 4 2 C4.66 2 5.32 2 6 2 C5.67 4.97 5.34 7.94 5 11 C4.01 11 3.02 11 2 11 C1.8453125 10.13375 1.8453125 10.13375 1.6875 9.25 C0.90207202 6.67950842 -0.30504197 5.06342716 -2 3 C-1.34 3 -0.68 3 0 3 C0 2.01 0 1.02 0 0 Z " fill="#891E2A" transform="translate(258,130)"/>
<path d="M0 0 C1.32 0.33 2.64 0.66 4 1 C3.3503125 1.61875 3.3503125 1.61875 2.6875 2.25 C-0.17331938 5.21677565 -2.26509222 8.26327555 -4 12 C-5.65 11.67 -7.3 11.34 -9 11 C-7.56111673 8.12223347 -5.2675702 6.2675702 -3 4 C-1.97186389 2.68824014 -0.95915568 1.3630107 0 0 Z " fill="#689861" transform="translate(222,434)"/>
<path d="M0 0 C0.66 0.33 1.32 0.66 2 1 C2.144375 1.598125 2.28875 2.19625 2.4375 2.8125 C2.87790071 5.10238354 2.87790071 5.10238354 4.5 7 C6.03866702 9.05155602 6.55426083 10.50386066 7 13 C5.35 13 3.7 13 2 13 C1.67 10.69 1.34 8.38 1 6 C0.34 6 -0.32 6 -1 6 C-1.042721 4.33388095 -1.04063832 2.66617115 -1 1 C-0.67 0.67 -0.34 0.34 0 0 Z M0 2 C1 4 1 4 1 4 Z M4 9 C5 11 5 11 5 11 Z " fill="#505C34" transform="translate(293,225)"/>
<path d="M0 0 C2.875 -0.1875 2.875 -0.1875 6 0 C6.66 0.99 7.32 1.98 8 3 C1.25 6.875 1.25 6.875 -1 8 C-1 6.68 -1 5.36 -1 4 C-1.66 3.67 -2.32 3.34 -3 3 C-1.68 2.67 -0.36 2.34 1 2 C0.67 1.34 0.34 0.68 0 0 Z " fill="#529243" transform="translate(186,398)"/>
<path d="M0 0 C2.70249451 0.37275786 3.79935135 0.78448849 5.6875 2.8125 C7.49265966 5.82109944 8.2396269 7.76763307 7.5625 11.25 C7.376875 11.8275 7.19125 12.405 7 13 C6.34 13 5.68 13 5 13 C4.87625 12.46375 4.7525 11.9275 4.625 11.375 C3.87394317 8.52098405 3.04340771 5.76196159 2 3 C1.34 2.67 0.68 2.34 0 2 C0 1.34 0 0.68 0 0 Z M4 5 C5 7 5 7 5 7 Z " fill="#5E6B40" transform="translate(408,181)"/>
<path d="M0 0 C3.66881155 0.70554068 6.70450534 2.27735506 10 4 C10 5.65 10 7.3 10 9 C9.34 9 8.68 9 8 9 C7.67 8.34 7.34 7.68 7 7 C6.01 6.67 5.02 6.34 4 6 C4 5.34 4 4.68 4 4 C2.35 3.67 0.7 3.34 -1 3 C-0.67 2.01 -0.34 1.02 0 0 Z " fill="#B4DD7E" transform="translate(215,58)"/>
<path d="M0 0 C1.32 0.33 2.64 0.66 4 1 C4.28875 2.134375 4.5775 3.26875 4.875 4.4375 C5.24625 5.613125 5.6175 6.78875 6 8 C6.66 8.33 7.32 8.66 8 9 C7.67 9.66 7.34 10.32 7 11 C4 11 4 11 2.375 9.4375 C0.62052407 6.32729266 0.33909158 3.52655246 0 0 Z M3 4 C4 6 4 6 4 6 Z " fill="#576634" transform="translate(436,137)"/>
<path d="M0 0 C3.74525799 3.74525799 3.68909949 7.98270909 4 13 C3.01 13.495 3.01 13.495 2 14 C-1.53846154 6 -1.53846154 6 -2 3 C-1.67 2.67 -1.34 2.34 -1 2 C-0.67 1.34 -0.34 0.68 0 0 Z " fill="#437638" transform="translate(119,366)"/>
<path d="M0 0 C0.33 0 0.66 0 1 0 C1.33 5.61 1.66 11.22 2 17 C-1.48990809 13.51009191 -1.43262017 12.55326487 -1.6875 7.8125 C-1.75324219 6.72582031 -1.81898438 5.63914062 -1.88671875 4.51953125 C-1.92410156 3.68808594 -1.96148437 2.85664063 -2 2 C-1.34 2 -0.68 2 0 2 C0 1.34 0 0.68 0 0 Z " fill="#637538" transform="translate(457,262)"/>
<path d="M0 0 C0.28875 0.9075 0.5775 1.815 0.875 2.75 C1.76531776 5.32202908 2.71494413 7.61346766 4 10 C1 10 1 10 -0.5625 8.5 C-1.036875 8.005 -1.51125 7.51 -2 7 C-2.66 7 -3.32 7 -4 7 C-3.814375 6.38125 -3.62875 5.7625 -3.4375 5.125 C-2.76313824 2.95839822 -2.76313824 2.95839822 -4 1 C-1 0 -1 0 0 0 Z " fill="#60994B" transform="translate(129,384)"/>
<path d="M0 0 C2 3 2 3 2 6 C2.66 6 3.32 6 4 6 C3.67 7.32 3.34 8.64 3 10 C0.03 9.505 0.03 9.505 -3 9 C-2.01 6.03 -1.02 3.06 0 0 Z " fill="#4F9739" transform="translate(79,367)"/>
<path d="M0 0 C0.33 0 0.66 0 1 0 C1 11.22 1 22.44 1 34 C0.67 34 0.34 34 0 34 C0 22.78 0 11.56 0 0 Z " fill="#000000" transform="translate(98,232)"/>
<path d="M0 0 C1 3 1 3 1 5 C-0.32 5 -1.64 5 -3 5 C-4.35368596 6.31266518 -5.68799596 7.64567325 -7 9 C-7.99 9 -8.98 9 -10 9 C-10 7.68 -10 6.36 -10 5 C-8.27473958 4.28385417 -6.54947917 3.56770833 -4.82421875 2.8515625 C-2.73466068 1.93193308 -2.73466068 1.93193308 0 0 Z " fill="#798F43" transform="translate(335,127)"/>
<path d="M0 0 C1.98 0.66 3.96 1.32 6 2 C6 2.66 6 3.32 6 4 C7.98 4.66 9.96 5.32 12 6 C12.33 7.65 12.66 9.3 13 11 C12.4225 10.54625 11.845 10.0925 11.25 9.625 C9.14271574 7.97387406 9.14271574 7.97387406 7.0625 7.1875 C3.94591588 5.39310308 2.20904508 2.82266871 0 0 Z " fill="#B3525D" transform="translate(245,121)"/>
<path d="M0 0 C0.33 0.66 0.66 1.32 1 2 C4.02934491 2.65772428 4.02934491 2.65772428 7 3 C6.319375 3.8353125 6.319375 3.8353125 5.625 4.6875 C3.96266232 7.05313439 2.97855457 9.29015658 2 12 C1.34 12 0.68 12 0 12 C0 8.04 0 4.08 0 0 Z M2 3 C3 5 3 5 3 5 Z " fill="#769C4C" transform="translate(160,65)"/>
<path d="M0 0 C4.8 3.44615385 4.8 3.44615385 5.8125 6.25 C5.874375 6.8275 5.93625 7.405 6 8 C5.4225 7.835 4.845 7.67 4.25 7.5 C1.73335631 6.85537969 1.73335631 6.85537969 -2 7 C-2.6875 5.1875 -2.6875 5.1875 -3 3 C-1.5625 1.25 -1.5625 1.25 0 0 Z M3 4 C4 6 4 6 4 6 Z " fill="#576F44" transform="translate(260,254)"/>
<path d="M0 0 C4.84734608 2.76486973 8.89301362 5.21006266 12 10 C12 10.66 12 11.32 12 12 C9.11835799 10.66413946 6.74723292 9.16362669 4.3125 7.125 C3.71050781 6.63257813 3.10851562 6.14015625 2.48828125 5.6328125 C0.79512501 3.77522902 0.39815079 2.45260887 0 0 Z " fill="#BBE189" transform="translate(185,32)"/>
<path d="M0 0 C0.99 0.33 1.98 0.66 3 1 C2.01 1.33 1.02 1.66 0 2 C0 3.65 0 5.3 0 7 C-1.65 7.66 -3.3 8.32 -5 9 C-4.5206753 4.68607774 -3.2542015 2.83430453 0 0 Z " fill="#429437" transform="translate(203,453)"/>
<path d="M0 0 C0.33 0.66 0.66 1.32 1 2 C0.02065076 3.67888441 -0.98343919 5.34338239 -2 7 C-2.71143088 8.98451771 -3.38991336 10.98202112 -4 13 C-4.99 13 -5.98 13 -7 13 C-6.36664937 7.61651963 -3.79089107 3.79089107 0 0 Z M-5 9 C-4 11 -4 11 -4 11 Z " fill="#3C4F36" transform="translate(278,322)"/>
<path d="M0 0 C2.64 0 5.28 0 8 0 C8 0.33 8 0.66 8 1 C6.35 1.33 4.7 1.66 3 2 C2.67 2.99 2.34 3.98 2 5 C-0.97 5 -3.94 5 -7 5 C-6.67 4.34 -6.34 3.68 -6 3 C-4.35 3 -2.7 3 -1 3 C-0.67 2.01 -0.34 1.02 0 0 Z " fill="#58692C" transform="translate(390,94)"/>
<path d="M0 0 C-0.33 1.32 -0.66 2.64 -1 4 C-1.66 4 -2.32 4 -3 4 C-3.268125 4.94875 -3.53625 5.8975 -3.8125 6.875 C-5 10 -5 10 -8 12 C-7.67 9.69 -7.34 7.38 -7 5 C-6.34 5 -5.68 5 -5 5 C-4.87625 4.360625 -4.7525 3.72125 -4.625 3.0625 C-4.41875 2.381875 -4.2125 1.70125 -4 1 C-2 0 -2 0 0 0 Z " fill="#7C8B62" transform="translate(109,48)"/>
<path d="M0 0 C0.99 0 1.98 0 3 0 C4.98 3.63 6.96 7.26 9 11 C7.35 10.67 5.7 10.34 4 10 C4 8.68 4 7.36 4 6 C3.01 5.67 2.02 5.34 1 5 C0.67 3.35 0.34 1.7 0 0 Z " fill="#5B6546" transform="translate(292,312)"/>
<path d="M0 0 C0.99 0 1.98 0 3 0 C2.71831703 1.95979427 2.42433283 3.91782378 2.125 5.875 C1.96257812 6.96554688 1.80015625 8.05609375 1.6328125 9.1796875 C1 12 1 12 -1 14 C-1.02685938 11.85423363 -1.04633088 9.70837355 -1.0625 7.5625 C-1.07410156 6.36753906 -1.08570313 5.17257813 -1.09765625 3.94140625 C-1 1 -1 1 0 0 Z " fill="#81944E" transform="translate(248,144)"/>
<path d="M0 0 C0.66 0.66 1.32 1.32 2 2 C1.7578125 4.8203125 1.7578125 4.8203125 1.125 8.125 C0.92132813 9.22070312 0.71765625 10.31640625 0.5078125 11.4453125 C0.34023437 12.28835938 0.17265625 13.13140625 0 14 C-0.33 14 -0.66 14 -1 14 C-1.16852247 12.39602723 -1.33474886 10.7918131 -1.5 9.1875 C-1.5928125 8.29417969 -1.685625 7.40085937 -1.78125 6.48046875 C-2 4 -2 4 -2 1 C-1.34 0.67 -0.68 0.34 0 0 Z M-1 6 C0 8 0 8 0 8 Z " fill="#466333" transform="translate(73,349)"/>
<path d="M0 0 C2.81340521 2.81340521 2.669115 5.09555696 3 9 C2.5625 11.9375 2.5625 11.9375 2 14 C-0.05619793 11.68677733 -0.95899829 10.44076838 -1.25 7.3125 C-1 5 -1 5 0 4 C0 2.68 0 1.36 0 0 Z M1 7 C2 9 2 9 2 9 Z " fill="#3C5F30" transform="translate(108,334)"/>
<path d="M0 0 C1.65 0 3.3 0 5 0 C5 0.66 5 1.32 5 2 C5.66 2.33 6.32 2.66 7 3 C4.6875 4.5625 4.6875 4.5625 2 6 C1.01 5.67 0.02 5.34 -1 5 C-0.67 3.35 -0.34 1.7 0 0 Z " fill="#5F712F" transform="translate(393,317)"/>
<path d="M0 0 C-1 3 -1 3 -3 5 C-5.26274788 4.64644564 -6.95088852 4.02455574 -9 3 C-7.01532024 -0.96935951 -3.9567243 -1.41311582 0 0 Z " fill="#535F37" transform="translate(317,239)"/>
<path d="M0 0 C0.66 0.33 1.32 0.66 2 1 C0.515 6.445 0.515 6.445 -1 12 C-3.26440734 7.47118531 -3.090125 5.81471876 -2 1 C-1.34 0.67 -0.68 0.34 0 0 Z " fill="#95CD64" transform="translate(77,125)"/>
<path d="M0 0 C1.2065625 0.0309375 1.2065625 0.0309375 2.4375 0.0625 C2.4375 0.7225 2.4375 1.3825 2.4375 2.0625 C3.4275 2.0625 4.4175 2.0625 5.4375 2.0625 C5.4375 3.0525 5.4375 4.0425 5.4375 5.0625 C4.4475 5.0625 3.4575 5.0625 2.4375 5.0625 C2.1075 4.4025 1.7775 3.7425 1.4375 3.0625 C0.7775 3.0625 0.1175 3.0625 -0.5625 3.0625 C-1.2225 3.7225 -1.8825 4.3825 -2.5625 5.0625 C-3.125 3.125 -3.125 3.125 -3.5625 1.0625 C-2.5625 0.0625 -2.5625 0.0625 0 0 Z M0.4375 4.0625 C1.0975 4.7225 1.7575 5.3825 2.4375 6.0625 C1.7775 6.0625 1.1175 6.0625 0.4375 6.0625 C0.4375 5.4025 0.4375 4.7425 0.4375 4.0625 Z " fill="#E1394D" transform="translate(249.5625,107.9375)"/>
<path d="M0 0 C2.31 0 4.62 0 7 0 C6.34 2.31 5.68 4.62 5 7 C3.35 6.67 1.7 6.34 0 6 C0.33 5.01 0.66 4.02 1 3 C0.67 2.01 0.34 1.02 0 0 Z M4 2 C5 4 5 4 5 4 Z " fill="#6A9047" transform="translate(109,146)"/>
<path d="M0 0 C2.31 0.33 4.62 0.66 7 1 C6.34 2.98 5.68 4.96 5 7 C2.5 5.75 2.5 5.75 0 4 C0 2.68 0 1.36 0 0 Z " fill="#832A34" transform="translate(265,125)"/>
<path d="M0 0 C0.33 0 0.66 0 1 0 C1.08131463 1.43655854 1.13933559 2.8744483 1.1875 4.3125 C1.23970703 5.51326172 1.23970703 5.51326172 1.29296875 6.73828125 C0.93801608 9.47851584 0.10633718 10.29171079 -2 12 C-2.05395478 10.37536158 -2.09277195 8.75021459 -2.125 7.125 C-2.14820313 6.22007812 -2.17140625 5.31515625 -2.1953125 4.3828125 C-2 2 -2 2 0 0 Z " fill="#65B345" transform="translate(66,288)"/>
<path d="M0 0 C0.99 0 1.98 0 3 0 C5 3 5 3 4.625 5.1875 C4.41875 5.785625 4.2125 6.38375 4 7 C3.01 7 2.02 7 1 7 C0.33333333 5 -0.33333333 3 -1 1 C-0.67 0.67 -0.34 0.34 0 0 Z " fill="#6CB948" transform="translate(265,276)"/>
<path d="M0 0 C1.66666667 0 3.33333333 0 5 0 C4.67 1.65 4.34 3.3 4 5 C3.01 5 2.02 5 1 5 C0.67 5.66 0.34 6.32 0 7 C-0.66 7 -1.32 7 -2 7 C-1.34 4.69 -0.68 2.38 0 0 Z " fill="#5F8741" transform="translate(255,262)"/>
<path d="M0 0 C0.66 0 1.32 0 2 0 C2.19392201 5.52677733 1.7479503 9.75614911 0 15 C-0.33 15 -0.66 15 -1 15 C-1.18451025 4.44191344 -1.18451025 4.44191344 0 0 Z " fill="#A2D275" transform="translate(70,151)"/>
<path d="M0 0 C0.33 0 0.66 0 1 0 C1 3.3 1 6.6 1 10 C-0.98 10.99 -0.98 10.99 -3 12 C-3.66 11.67 -4.32 11.34 -5 11 C-5 10.34 -5 9.68 -5 9 C-4.01 9 -3.02 9 -2 9 C-1.22678118 6.01758453 -0.58803797 3.02419525 0 0 Z " fill="#843040" transform="translate(268,132)"/>
<path d="M0 0 C-0.33 2.97 -0.66 5.94 -1 9 C-1.99 9 -2.98 9 -4 9 C-4.75 6.75 -4.75 6.75 -5 4 C-1.75675676 0 -1.75675676 0 0 0 Z " fill="#A70C1F" transform="translate(267,132)"/>
<path d="M0 0 C0.103125 0.61875 0.20625 1.2375 0.3125 1.875 C0.87525373 4.36526484 0.87525373 4.36526484 4 6 C1 7 1 7 -1.5625 6.3125 C-4.29875437 4.83913226 -4.94958421 3.86477034 -6 1 C-3.03 1.495 -3.03 1.495 0 2 C0 1.34 0 0.68 0 0 Z " fill="#9FCD6A" transform="translate(151,126)"/>
<path d="M0 0 C4.28806873 0.47645208 6.26647487 1.65902484 9 5 C9 5.66 9 6.32 9 7 C5.625 6.3125 5.625 6.3125 2 5 C0.5625 2.375 0.5625 2.375 0 0 Z " fill="#419137" transform="translate(135,466)"/>
<path d="M0 0 C3.93846154 3.32307692 3.93846154 3.32307692 4.25 6.75 C4.1675 7.4925 4.085 8.235 4 9 C3.67 8.34 3.34 7.68 3 7 C2.34 7 1.68 7 1 7 C0.67 6.34 0.34 5.68 0 5 C-0.99 4.34 -1.98 3.68 -3 3 C-2.34 3 -1.68 3 -1 3 C-0.67 2.01 -0.34 1.02 0 0 Z " fill="#4B8543" transform="translate(113,445)"/>
<path d="M0 0 C1.1875 1.5625 1.1875 1.5625 2 4 C0.625 7.75 0.625 7.75 -1 11 C-2.61949011 8.42786866 -3.04408751 7.32330841 -2.625 4.25 C-2.41875 3.5075 -2.2125 2.765 -2 2 C-1.34 2 -0.68 2 0 2 C0 1.34 0 0.68 0 0 Z " fill="#426B3C" transform="translate(230,420)"/>
<path d="M0 0 C1.32 0.66 2.64 1.32 4 2 C3.01 3.98 2.02 5.96 1 8 C0.01 7.67 -0.98 7.34 -2 7 C-1.34 4.69 -0.68 2.38 0 0 Z " fill="#A9D46F" transform="translate(88,85)"/>
<path d="M0 0 C3.96 0.33 7.92 0.66 12 1 C11.34 1.66 10.68 2.32 10 3 C6.875 2.625 6.875 2.625 4 2 C4 2.66 4 3.32 4 4 C2.68 4 1.36 4 0 4 C0 2.68 0 1.36 0 0 Z " fill="#667845" transform="translate(395,384)"/>
<path d="M0 0 C0.33 2.64 0.66 5.28 1 8 C-1.31 6.02 -3.62 4.04 -6 2 C-3 0 -3 0 0 0 Z " fill="#81994D" transform="translate(326,353)"/>
<path d="M0 0 C0.33 1.32 0.66 2.64 1 4 C-2.3 4 -5.6 4 -9 4 C-9 3.34 -9 2.68 -9 2 C-6.94921875 1.77213542 -4.8984375 1.54427083 -2.84765625 1.31640625 C-0.98859771 1.18113386 -0.98859771 1.18113386 0 0 Z " fill="#A7DE7A" transform="translate(174,133)"/>
<path d="M0 0 C-1.39852912 2.79705825 -3.13651858 2.90914993 -6 4 C-6.99 4.66 -7.98 5.32 -9 6 C-9.33 4.35 -9.66 2.7 -10 1 C-6.52674819 -0.1577506 -3.63932552 -0.06866652 0 0 Z " fill="#AAD570" transform="translate(145,22)"/>
<path d="M0 0 C0.99 0.33 1.98 0.66 3 1 C1.625 3.5 1.625 3.5 0 6 C-0.66 6 -1.32 6 -2 6 C-2.66 7.32 -3.32 8.64 -4 10 C-3.43454163 6.04179141 -2.19097652 3.3340947 0 0 Z " fill="#78AE5C" transform="translate(246,289)"/>
<path d="M0 0 C0.99 0.33 1.98 0.66 3 1 C3.8125 2.9375 3.8125 2.9375 4 5 C3.34 5.66 2.68 6.32 2 7 C2 6.34 2 5.68 2 5 C1.34 5 0.68 5 0 5 C-0.33 5.66 -0.66 6.32 -1 7 C-1.33 5.02 -1.66 3.04 -2 1 C-1.34 0.67 -0.68 0.34 0 0 Z M-1 2 C0 4 0 4 0 4 Z " fill="#506422" transform="translate(268,246)"/>
<path d="M0 0 C-0.99 0.33 -1.98 0.66 -3 1 C-3 1.66 -3 2.32 -3 3 C-4.62626404 4.38232443 -6.2925002 5.71937515 -8 7 C-8.66 6.67 -9.32 6.34 -10 6 C-6.57724958 0.25466893 -6.57724958 0.25466893 -3.875 -0.9375 C-2 -1 -2 -1 0 0 Z " fill="#8DA15E" transform="translate(362,174)"/>
<path d="M0 0 C0.33 1.32 0.66 2.64 1 4 C2.65 4.33 4.3 4.66 6 5 C5.67 5.66 5.34 6.32 5 7 C4.34 6.67 3.68 6.34 3 6 C3 6.66 3 7.32 3 8 C1.68 7.67 0.36 7.34 -1 7 C-0.67 4.69 -0.34 2.38 0 0 Z " fill="#9CCC5E" transform="translate(160,58)"/>
<path d="M0 0 C4.75 0.75 4.75 0.75 7 3 C7 3.99 7 4.98 7 6 C4.50638429 4.79618552 2.31856917 3.54571278 0 2 C0 1.34 0 0.68 0 0 Z " fill="#5E9A56" transform="translate(130,465)"/>
<path d="M0 0 C0.66 0 1.32 0 2 0 C2.66 0.66 3.32 1.32 4 2 C4.66 2 5.32 2 6 2 C6.33 3.32 6.66 4.64 7 6 C5.35 6.33 3.7 6.66 2 7 C1.34 4.69 0.68 2.38 0 0 Z " fill="#417737" transform="translate(125,460)"/>
<path d="M0 0 C1.32 0.66 2.64 1.32 4 2 C4 3.98 4 5.96 4 8 C3.34 8 2.68 8 2 8 C2 7.34 2 6.68 2 6 C1.34 6 0.68 6 0 6 C-0.38218767 4.34385343 -0.71395102 2.67542976 -1 1 C-0.67 0.67 -0.34 0.34 0 0 Z " fill="#60A745" transform="translate(103,330)"/>
<path d="M0 0 C2.97 0.495 2.97 0.495 6 1 C5.67 1.99 5.34 2.98 5 4 C2.69 3.67 0.38 3.34 -2 3 C-1.34 2.01 -0.68 1.02 0 0 Z " fill="#626F3E" transform="translate(251,141)"/>
<path d="M0 0 C2.31 1.98 4.62 3.96 7 6 C6.67 6.66 6.34 7.32 6 8 C4.02 7.34 2.04 6.68 0 6 C0 4.02 0 2.04 0 0 Z " fill="#697943" transform="translate(428,123)"/>
<path d="M0 0 C0.66 0.33 1.32 0.66 2 1 C2.33 1.99 2.66 2.98 3 4 C3.66 4.33 4.32 4.66 5 5 C5.625 7.0625 5.625 7.0625 6 9 C4.0625 8.1875 4.0625 8.1875 2 7 C1.67 6.01 1.34 5.02 1 4 C0.34 4 -0.32 4 -1 4 C-0.67 2.68 -0.34 1.36 0 0 Z " fill="#ACCC70" transform="translate(197,42)"/>
<path d="M0 0 C-5.41538462 4.06153846 -5.41538462 4.06153846 -8.375 3.75 C-8.91125 3.5025 -9.4475 3.255 -10 3 C-10 2.34 -10 1.68 -10 1 C-3.375 -1.125 -3.375 -1.125 0 0 Z " fill="#9FC067" transform="translate(131,30)"/>
<path d="M0 0 C3.14624993 -0.26218749 4.61837017 -0.24754367 7.3125 1.5 C8.1478125 2.2425 8.1478125 2.2425 9 3 C6.08517222 3.80967438 4.53886783 4.21845993 1.6875 3.0625 C1.130625 2.711875 0.57375 2.36125 0 2 C0 1.34 0 0.68 0 0 Z " fill="#B6DF82" transform="translate(162,20)"/>
<path d="M0 0 C0.66 1.32 1.32 2.64 2 4 C-4.4 4.36923077 -4.4 4.36923077 -7.4375 2.5 C-7.953125 2.005 -8.46875 1.51 -9 1 C-4.545 0.505 -4.545 0.505 0 0 Z " fill="#3D7C35" transform="translate(163,475)"/>
<path d="M0 0 C1.32 0 2.64 0 4 0 C3.67 2.31 3.34 4.62 3 7 C1.68 6.34 0.36 5.68 -1 5 C-0.67 3.35 -0.34 1.7 0 0 Z " fill="#708645" transform="translate(282,286)"/>
<path d="M0 0 C1.2065625 0.0309375 1.2065625 0.0309375 2.4375 0.0625 C2.1075 1.3825 1.7775 2.7025 1.4375 4.0625 C0.7775 4.0625 0.1175 4.0625 -0.5625 4.0625 C-0.8925 5.0525 -1.2225 6.0425 -1.5625 7.0625 C-2.2225 5.0825 -2.8825 3.1025 -3.5625 1.0625 C-2.5625 0.0625 -2.5625 0.0625 0 0 Z " fill="#545E31" transform="translate(331.5625,208.9375)"/>
<path d="M0 0 C3.34249629 0.59687434 5.46436342 1.73603877 8 4 C8 4.66 8 5.32 8 6 C2.33846154 4.52307692 2.33846154 4.52307692 0.625 1.875 C0.41875 1.25625 0.2125 0.6375 0 0 Z " fill="#CC5D6C" transform="translate(255,110)"/>
<path d="M0 0 C0.66 0 1.32 0 2 0 C1.49259538 4.39750672 -1.08293314 6.86948922 -4 10 C-4.66 10 -5.32 10 -6 10 C-6 8 -6 8 -4.125 6.125 C-3.42375 5.42375 -2.7225 4.7225 -2 4 C-0.76487921 1.86690808 -0.76487921 1.86690808 0 0 Z " fill="#B0DF6D" transform="translate(106,52)"/>
<path d="M0 0 C1.4540625 0.0309375 1.4540625 0.0309375 2.9375 0.0625 C1.9475 0.3925 0.9575 0.7225 -0.0625 1.0625 C0.2675 3.0425 0.5975 5.0225 0.9375 7.0625 C0.6075 6.4025 0.2775 5.7425 -0.0625 5.0625 C-0.7225 5.0625 -1.3825 5.0625 -2.0625 5.0625 C-2.7225 3.7425 -3.3825 2.4225 -4.0625 1.0625 C-3.0625 0.0625 -3.0625 0.0625 0 0 Z " fill="#578E4C" transform="translate(147.0625,404.9375)"/>
<path d="M0 0 C1.32 0 2.64 0 4 0 C4.33 1.65 4.66 3.3 5 5 C3.68 5 2.36 5 1 5 C0 1.125 0 1.125 0 0 Z " fill="#4EA338" transform="translate(197,388)"/>
<path d="M0 0 C0.33 0 0.66 0 1 0 C1.625 2.8125 1.625 2.8125 2 6 C1.01 7.485 1.01 7.485 0 9 C-0.66 9 -1.32 9 -2 9 C-2 5.20442119 -1.49821059 3.37097383 0 0 Z " fill="#578848" transform="translate(83,383)"/>
<path d="M0 0 C1.32 0 2.64 0 4 0 C4 1.65 4 3.3 4 5 C3.01 5 2.02 5 1 5 C0.67 5.66 0.34 6.32 0 7 C0 4.69 0 2.38 0 0 Z " fill="#848D55" transform="translate(438,337)"/>
<path d="M0 0 C0.66 0 1.32 0 2 0 C1.01 2.97 0.02 5.94 -1 9 C-1.66 9 -2.32 9 -3 9 C-2.5020163 5.26512223 -2.12508244 3.18762365 0 0 Z " fill="#63A948" transform="translate(272,326)"/>
<path d="M0 0 C0.268125 0.639375 0.53625 1.27875 0.8125 1.9375 C1.88667752 4.33131686 1.88667752 4.33131686 5 5 C5 5.99 5 6.98 5 8 C3.68 7.67 2.36 7.34 1 7 C0.67 4.69 0.34 2.38 0 0 Z " fill="#B2D782" transform="translate(163,72)"/>
<path d="M0 0 C0.99 0.33 1.98 0.66 3 1 C3.33 2.65 3.66 4.3 4 6 C2.68 6.33 1.36 6.66 0 7 C0 4.69 0 2.38 0 0 Z " fill="#448F37" transform="translate(118,450)"/>
<path d="M0 0 C1.485 0.99 1.485 0.99 3 2 C3.1875 4.625 3.1875 4.625 3 7 C2.01 7 1.02 7 0 7 C-1.125 2.25 -1.125 2.25 0 0 Z " fill="#4D7646" transform="translate(90,408)"/>
<path d="M0 0 C0.33 0.66 0.66 1.32 1 2 C1.99 1.67 2.98 1.34 4 1 C2.92598892 3.91517292 2.22189824 5.77810176 0 8 C-0.33 7.67 -0.66 7.34 -1 7 C-0.71269945 4.66055264 -0.38063221 2.3260857 0 0 Z " fill="#365230" transform="translate(240,401)"/>
<path d="M0 0 C0.61875 0.7734375 0.61875 0.7734375 1.25 1.5625 C-1.96451269 3.16975635 -5.18612536 2.61998185 -8.75 2.5625 C-7.17932829 0.75622753 -5.95700414 -0.34693569 -3.75 -1.3125 C-1.75 -1.4375 -1.75 -1.4375 0 0 Z " fill="#9BD265" transform="translate(191.75,130.4375)"/>
<path d="M0 0 C2.475 0.495 2.475 0.495 5 1 C5 2.65 5 4.3 5 6 C4.01 5.67 3.02 5.34 2 5 C2 4.34 2 3.68 2 3 C1.34 2.67 0.68 2.34 0 2 C0 1.34 0 0.68 0 0 Z " fill="#E76B79" transform="translate(237,99)"/>
<path d="M0 0 C-2.79908133 2.79908133 -5.13081763 2.72362983 -9 3 C-9.66 2.34 -10.32 1.68 -11 1 C-3.375 -1.125 -3.375 -1.125 0 0 Z " fill="#A5DD68" transform="translate(180,81)"/>
<path d="M0 0 C0.99 0 1.98 0 3 0 C3.75 1.75 3.75 1.75 4 4 C2.0625 6.25 2.0625 6.25 0 8 C0 5.36 0 2.72 0 0 Z " fill="#A1CC73" transform="translate(96,64)"/>
<path d="M0 0 C0 0.33 0 0.66 0 1 C-5.61 1 -11.22 1 -17 1 C-17 0.67 -17 0.34 -17 0 C-14.72979256 -0.19493195 -12.45879711 -0.38070418 -10.1875 -0.5625 C-8.92292969 -0.66691406 -7.65835938 -0.77132813 -6.35546875 -0.87890625 C-3 -1 -3 -1 0 0 Z " fill="#000000" transform="translate(163,17)"/>
<path d="M0 0 C1.32 0 2.64 0 4 0 C4.33 0.99 4.66 1.98 5 3 C3.35 3.33 1.7 3.66 0 4 C-0.33 3.01 -0.66 2.02 -1 1 C-0.67 0.67 -0.34 0.34 0 0 Z " fill="#5D9051" transform="translate(198,384)"/>
<path d="M0 0 C2.5 2.3125 2.5 2.3125 5 5 C5 5.99 5 6.98 5 8 C3.68 7.67 2.36 7.34 1 7 C0.67 4.69 0.34 2.38 0 0 Z " fill="#879D5A" transform="translate(319,273)"/>
<path d="M0 0 C1.125 1.75 1.125 1.75 2 4 C1.03284133 6.65968633 -0.41948242 8.62922362 -2 11 C-1 3.57142857 -1 3.57142857 0 0 Z " fill="#93D158" transform="translate(74,139)"/>
<path d="M0 0 C0.93423645 3.01031744 1.04449911 3.86650268 0 7 C-0.66 7 -1.32 7 -2 7 C-2.33 5.35 -2.66 3.7 -3 2 C-2.01 1.34 -1.02 0.68 0 0 Z " fill="#95B673" transform="translate(118,135)"/>
<path d="M0 0 C0.66 0.33 1.32 0.66 2 1 C0.9024777 3.99324263 0.32317108 4.84610901 -2.625 6.25 C-3.40875 6.4975 -4.1925 6.745 -5 7 C-3.70700306 4.11562221 -2.34058637 2.12780579 0 0 Z " fill="#8EA15B" transform="translate(345,113)"/>
<path d="M0 0 C0.78375 0.185625 1.5675 0.37125 2.375 0.5625 C4.97089775 1.25962266 4.97089775 1.25962266 7 0 C6.67 1.32 6.34 2.64 6 4 C4.68 4.33 3.36 4.66 2 5 C2 3.68 2 2.36 2 1 C1.34 0.67 0.68 0.34 0 0 Z " fill="#6A8B56" transform="translate(175,74)"/>
<path d="M0 0 C0.66 0 1.32 0 2 0 C1.67 1.98 1.34 3.96 1 6 C1.66 6.33 2.32 6.66 3 7 C2.01 7 1.02 7 0 7 C0 6.34 0 5.68 0 5 C-0.66 4.67 -1.32 4.34 -2 4 C-1.34 2.68 -0.68 1.36 0 0 Z " fill="#377733" transform="translate(186,467)"/>
<path d="M0 0 C1.231394 2.46278801 1.07159196 4.2795055 1 7 C-0.32 6.67 -1.64 6.34 -3 6 C-2.625 3.5625 -2.625 3.5625 -2 1 C-1.34 0.67 -0.68 0.34 0 0 Z " fill="#3C7934" transform="translate(212,446)"/>
<path d="M0 0 C0.99 0.66 1.98 1.32 3 2 C0.8614515 4.1385485 -0.13275314 4.42655063 -3 5 C-3 4.01 -3 3.02 -3 2 C-2.01 1.34 -1.02 0.68 0 0 Z " fill="#4B823F" transform="translate(217,441)"/>
<path d="M0 0 C2.50037734 2.17424117 3.43628586 3.73045798 4 7 C2.68 6.67 1.36 6.34 0 6 C-0.38218767 4.34385343 -0.71395102 2.67542976 -1 1 C-0.67 0.67 -0.34 0.34 0 0 Z " fill="#829B4E" transform="translate(330,361)"/>
<path d="M0 0 C0.33 0.66 0.66 1.32 1 2 C-1.40983607 6.70491803 -1.40983607 6.70491803 -4 8 C-3.6875 5.125 -3.6875 5.125 -3 2 C-2.01 1.34 -1.02 0.68 0 0 Z " fill="#7C974F" transform="translate(429,358)"/>
<path d="M0 0 C0.66 0.33 1.32 0.66 2 1 C1.25 5.75 1.25 5.75 -1 8 C-1.93065133 5.39417629 -2.14917407 4.35801776 -1.0625 1.75 C-0.711875 1.1725 -0.36125 0.595 0 0 Z M0 2 C1 4 1 4 1 4 Z " fill="#4D6343" transform="translate(227,328)"/>
<path d="M0 0 C1.98 0.99 3.96 1.98 6 3 C5.01 3.66 4.02 4.32 3 5 C1.68 4.34 0.36 3.68 -1 3 C-0.67 2.01 -0.34 1.02 0 0 Z " fill="#6C7D3C" transform="translate(328,285)"/>
<path d="M0 0 C0.99 0 1.98 0 3 0 C2.25 4.75 2.25 4.75 0 7 C-0.66 5.68 -1.32 4.36 -2 3 C-1.34 3 -0.68 3 0 3 C0 2.01 0 1.02 0 0 Z " fill="#6E1F29" transform="translate(258,130)"/>
<path d="M0 0 C0.99 0.66 1.98 1.32 3 2 C2.67 3.65 2.34 5.3 2 7 C1.34 6.67 0.68 6.34 0 6 C0 5.34 0 4.68 0 4 C-0.66 3.67 -1.32 3.34 -2 3 C-1.34 3 -0.68 3 0 3 C0 2.01 0 1.02 0 0 Z " fill="#B7142C" transform="translate(264,128)"/>
<path d="M0 0 C2.475 0.495 2.475 0.495 5 1 C5.33 2.32 5.66 3.64 6 5 C4.35 4.67 2.7 4.34 1 4 C0.67 2.68 0.34 1.36 0 0 Z " fill="#A14952" transform="translate(251,106)"/>
<path d="M0 0 C0.33 0 0.66 0 1 0 C0.67 4.62 0.34 9.24 0 14 C-0.33 14 -0.66 14 -1 14 C-1.08333357 9.1666528 -0.95261487 4.76307437 0 0 Z " fill="#000000" transform="translate(64,177)"/>
<path d="M0 0 C4.95 0 9.9 0 15 0 C15 0.33 15 0.66 15 1 C10.05 1 5.1 1 0 1 C0 0.67 0 0.34 0 0 Z " fill="#000000" transform="translate(162,139)"/>
<path d="M0 0 C0.33 0 0.66 0 1 0 C1 4.62 1 9.24 1 14 C0.67 14 0.34 14 0 14 C0 9.38 0 4.76 0 0 Z " fill="#000000" transform="translate(245,146)"/>
<path d="M0 0 C0.33 0 0.66 0 1 0 C1 4.29 1 8.58 1 13 C0.67 13 0.34 13 0 13 C0 8.71 0 4.42 0 0 Z " fill="#000000" transform="translate(421,246)"/>
<path d="M0 0 C0.33 0 0.66 0 1 0 C1.98248524 4.0527516 2.08159574 7.83861737 2 12 C1.67 12 1.34 12 1 12 C0.67 8.04 0.34 4.08 0 0 Z " fill="#000000" transform="translate(456,190)"/>
<path d="M0 0 C0.33 0 0.66 0 1 0 C1 3.63 1 7.26 1 11 C0.67 11 0.34 11 0 11 C0 7.37 0 3.74 0 0 Z " fill="#000000" transform="translate(421,224)"/>
<path d="M0 0 C3.3 0 6.6 0 10 0 C10 0.33 10 0.66 10 1 C6.7 1 3.4 1 0 1 C0 0.67 0 0.34 0 0 Z " fill="#000000" transform="translate(382,319)"/>
<path d="M0 0 C0.33 0 0.66 0 1 0 C1 3.3 1 6.6 1 10 C0.67 10 0.34 10 0 10 C0 6.7 0 3.4 0 0 Z " fill="#000000" transform="translate(99,271)"/>
<path d="M0 0 C0.33 0 0.66 0 1 0 C1 3.3 1 6.6 1 10 C0.67 10 0.34 10 0 10 C0 6.7 0 3.4 0 0 Z " fill="#000000" transform="translate(100,207)"/>
<path d="M0 0 C3.3 0 6.6 0 10 0 C10 0.33 10 0.66 10 1 C6.7 1 3.4 1 0 1 C0 0.67 0 0.34 0 0 Z " fill="#000000" transform="translate(192,133)"/>
<path d="M0 0 C2.97 0 5.94 0 9 0 C9 0.33 9 0.66 9 1 C6.03 1 3.06 1 0 1 C0 0.67 0 0.34 0 0 Z " fill="#000000" transform="translate(377,392)"/>
<path d="M0 0 C0.33 0 0.66 0 1 0 C1 2.97 1 5.94 1 9 C0.67 9 0.34 9 0 9 C0 6.03 0 3.06 0 0 Z " fill="#000000" transform="translate(99,219)"/>
<path d="M0 0 C2.97 0 5.94 0 9 0 C9 0.33 9 0.66 9 1 C6.03 1 3.06 1 0 1 C0 0.67 0 0.34 0 0 Z " fill="#000000" transform="translate(213,130)"/>
<path d="M0 0 C2.875 -0.125 2.875 -0.125 6 0 C6.66 0.66 7.32 1.32 8 2 C5.36 1.67 2.72 1.34 0 1 C0 0.67 0 0.34 0 0 Z " fill="#000000" transform="translate(234,119)"/>
<path d="M0 0 C2.97 0 5.94 0 9 0 C9 0.33 9 0.66 9 1 C6.03 1 3.06 1 0 1 C0 0.67 0 0.34 0 0 Z " fill="#000000" transform="translate(372,94)"/>
<path d="M0 0 C0.94875 0.04125 1.8975 0.0825 2.875 0.125 C2.875 0.455 2.875 0.785 2.875 1.125 C0.235 1.455 -2.405 1.785 -5.125 2.125 C-3.125 0.125 -3.125 0.125 0 0 Z " fill="#000000" transform="translate(143.125,17.875)"/>
<path d="M0 0 C2.64 0 5.28 0 8 0 C8 0.33 8 0.66 8 1 C5.36 1 2.72 1 0 1 C0 0.67 0 0.34 0 0 Z " fill="#000000" transform="translate(371,319)"/>
<path d="M0 0 C0.625 1.8125 0.625 1.8125 1 4 C0.34 4.99 -0.32 5.98 -1 7 C-0.67 4.69 -0.34 2.38 0 0 Z " fill="#000000" transform="translate(451,311)"/>
<path d="M0 0 C0.33 0 0.66 0 1 0 C1 2.64 1 5.28 1 8 C0.67 8 0.34 8 0 8 C0 5.36 0 2.72 0 0 Z " fill="#000000" transform="translate(101,293)"/>
<path d="M0 0 C0.33 0 0.66 0 1 0 C1 2.64 1 5.28 1 8 C0.67 8 0.34 8 0 8 C0 5.36 0 2.72 0 0 Z " fill="#000000" transform="translate(66,163)"/>
<path d="M0 0 C2.31 0 4.62 0 7 0 C7 0.33 7 0.66 7 1 C4.69 1 2.38 1 0 1 C0 0.67 0 0.34 0 0 Z " fill="#000000" transform="translate(150,479)"/>
<path d="M0 0 C0.33 0 0.66 0 1 0 C1 2.31 1 4.62 1 7 C0.67 7 0.34 7 0 7 C0 4.69 0 2.38 0 0 Z " fill="#000000" transform="translate(66,328)"/>
<path d="M0 0 C2.97 0.495 2.97 0.495 6 1 C5.01 1.33 4.02 1.66 3 2 C2.01 1.34 1.02 0.68 0 0 Z " fill="#000000" transform="translate(361,315)"/>
<path d="M0 0 C0.33 0 0.66 0 1 0 C1 2.31 1 4.62 1 7 C0.67 7 0.34 7 0 7 C0 4.69 0 2.38 0 0 Z " fill="#000000" transform="translate(283,305)"/>
<path d="M0 0 C0.33 0 0.66 0 1 0 C1 2.31 1 4.62 1 7 C0.67 7 0.34 7 0 7 C0 4.69 0 2.38 0 0 Z " fill="#000000" transform="translate(102,302)"/>
<path d="M0 0 C0.33 0 0.66 0 1 0 C1 2.31 1 4.62 1 7 C0.67 7 0.34 7 0 7 C0 4.69 0 2.38 0 0 Z " fill="#000000" transform="translate(457,280)"/>
<path d="M0 0 C0.99 1.485 0.99 1.485 2 3 C1.67 3.99 1.34 4.98 1 6 C0.67 4.02 0.34 2.04 0 0 Z " fill="#000000" transform="translate(257,217)"/>
<path d="M0 0 C0.33 0 0.66 0 1 0 C1 2.31 1 4.62 1 7 C0.67 7 0.34 7 0 7 C0 4.69 0 2.38 0 0 Z " fill="#000000" transform="translate(101,200)"/>
<path d="M0 0 C0.33 0 0.66 0 1 0 C1 2.31 1 4.62 1 7 C0.67 7 0.34 7 0 7 C0 4.69 0 2.38 0 0 Z " fill="#000000" transform="translate(247,166)"/>
<path d="M0 0 C2.97 0.495 2.97 0.495 6 1 C5.01 1.33 4.02 1.66 3 2 C2.01 1.34 1.02 0.68 0 0 Z " fill="#000000" transform="translate(171,21)"/>
<path d="M0 0 C2.125 0.375 2.125 0.375 4 1 C2.02 1.33 0.04 1.66 -2 2 C-1.34 1.34 -0.68 0.68 0 0 Z " fill="#000000" transform="translate(134,21)"/>
<path d="M0 0 C0.33 0 0.66 0 1 0 C1 1.98 1 3.96 1 6 C0.67 6 0.34 6 0 6 C0 4.02 0 2.04 0 0 Z " fill="#000000" transform="translate(65,322)"/>
<path d="M0 0 C1.98 0.99 1.98 0.99 4 2 C2.68 2 1.36 2 0 2 C0 1.34 0 0.68 0 0 Z " fill="#000000" transform="translate(367,317)"/>
<path d="M0 0 C0.33 0 0.66 0 1 0 C1 1.98 1 3.96 1 6 C0.67 6 0.34 6 0 6 C0 4.02 0 2.04 0 0 Z " fill="#000000" transform="translate(62,301)"/>
<path d="M0 0 C0.33 0 0.66 0 1 0 C1 1.98 1 3.96 1 6 C0.67 6 0.34 6 0 6 C0 4.02 0 2.04 0 0 Z " fill="#000000" transform="translate(456,287)"/>
<path d="M0 0 C0.33 0 0.66 0 1 0 C1 1.98 1 3.96 1 6 C0.67 6 0.34 6 0 6 C0 4.02 0 2.04 0 0 Z " fill="#000000" transform="translate(420,260)"/>
<path d="M0 0 C0.33 0 0.66 0 1 0 C1 1.98 1 3.96 1 6 C0.67 6 0.34 6 0 6 C0 4.02 0 2.04 0 0 Z " fill="#000000" transform="translate(246,160)"/>
<path d="M0 0 C0.33 0 0.66 0 1 0 C1 1.65 1 3.3 1 5 C0.67 5 0.34 5 0 5 C0 3.35 0 1.7 0 0 Z " fill="#000000" transform="translate(67,335)"/>
<path d="M0 0 C0.99 0.495 0.99 0.495 2 1 C1.67 1.99 1.34 2.98 1 4 C0.67 2.68 0.34 1.36 0 0 Z " fill="#000000" transform="translate(273,283)"/>
<path d="M0 0 C0.33 0 0.66 0 1 0 C1 1.65 1 3.3 1 5 C0.67 5 0.34 5 0 5 C0 3.35 0 1.7 0 0 Z " fill="#000000" transform="translate(419,266)"/>
<path d="M0 0 C0.33 0 0.66 0 1 0 C1 1.65 1 3.3 1 5 C0.67 5 0.34 5 0 5 C0 3.35 0 1.7 0 0 Z " fill="#000000" transform="translate(62,193)"/>
<path d="M0 0 C0.33 0 0.66 0 1 0 C1 1.65 1 3.3 1 5 C0.67 5 0.34 5 0 5 C0 3.35 0 1.7 0 0 Z " fill="#000000" transform="translate(248,176)"/>
<path d="M0 0 C1.65 0 3.3 0 5 0 C5 0.33 5 0.66 5 1 C3.35 1 1.7 1 0 1 C0 0.67 0 0.34 0 0 Z " fill="#000000" transform="translate(369,168)"/>
<path d="M0 0 C0.33 0 0.66 0 1 0 C1 1.65 1 3.3 1 5 C0.67 5 0.34 5 0 5 C0 3.35 0 1.7 0 0 Z " fill="#000000" transform="translate(67,158)"/>
<path d="M0 0 C1.65 0 3.3 0 5 0 C5 0.33 5 0.66 5 1 C3.35 1 1.7 1 0 1 C0 0.67 0 0.34 0 0 Z " fill="#000000" transform="translate(183,136)"/>
<path d="M0 0 C0.33 0 0.66 0 1 0 C1 1.65 1 3.3 1 5 C0.67 5 0.34 5 0 5 C0 3.35 0 1.7 0 0 Z " fill="#000000" transform="translate(72,131)"/>
<path d="M0 0 C1.65 0 3.3 0 5 0 C5 0.33 5 0.66 5 1 C3.35 1 1.7 1 0 1 C0 0.67 0 0.34 0 0 Z " fill="#000000" transform="translate(262,112)"/>
<path d="M0 0 C1.65 0 3.3 0 5 0 C5 0.33 5 0.66 5 1 C3.35 1 1.7 1 0 1 C0 0.67 0 0.34 0 0 Z " fill="#000000" transform="translate(163,18)"/>
<path d="M0 0 C4 1 4 1 4 1 Z " fill="#000000" transform="translate(357,386)"/>
<path d="M0 0 C1 4 1 4 1 4 Z " fill="#000000" transform="translate(75,370)"/>
<path d="M0 0 C1 4 1 4 1 4 Z " fill="#000000" transform="translate(113,349)"/>
<path d="M0 0 C1 4 1 4 1 4 Z " fill="#000000" transform="translate(69,346)"/>
<path d="M0 0 C1 4 1 4 1 4 Z " fill="#000000" transform="translate(107,328)"/>
<path d="M0 0 C1 4 1 4 1 4 Z " fill="#000000" transform="translate(106,324)"/>
<path d="M0 0 C1 4 1 4 1 4 Z " fill="#000000" transform="translate(104,314)"/>
<path d="M0 0 C1 4 1 4 1 4 Z " fill="#000000" transform="translate(454,298)"/>
<path d="M0 0 C1 4 1 4 1 4 Z " fill="#000000" transform="translate(455,293)"/>
<path d="M0 0 C1 4 1 4 1 4 Z " fill="#000000" transform="translate(417,277)"/>
<path d="M0 0 C1 4 1 4 1 4 Z " fill="#000000" transform="translate(418,273)"/>
<path d="M0 0 C1 4 1 4 1 4 Z " fill="#000000" transform="translate(255,208)"/>
<path d="M0 0 C1 4 1 4 1 4 Z " fill="#000000" transform="translate(418,207)"/>
<path d="M0 0 C1 4 1 4 1 4 Z " fill="#000000" transform="translate(417,203)"/>
<path d="M0 0 C0.99 0.495 0.99 0.495 2 1 C1.67 1.66 1.34 2.32 1 3 C0.67 2.01 0.34 1.02 0 0 Z " fill="#000000" transform="translate(281,200)"/>
<path d="M0 0 C1 4 1 4 1 4 Z " fill="#000000" transform="translate(286,196)"/>
<path d="M0 0 C1 4 1 4 1 4 Z " fill="#000000" transform="translate(455,186)"/>
<path d="M0 0 C1 4 1 4 1 4 Z " fill="#000000" transform="translate(454,180)"/>
<path d="M0 0 C1 4 1 4 1 4 Z " fill="#000000" transform="translate(65,173)"/>
<path d="M0 0 C1 4 1 4 1 4 Z " fill="#000000" transform="translate(107,170)"/>
<path d="M0 0 C1 4 1 4 1 4 Z " fill="#000000" transform="translate(451,169)"/>
<path d="M0 0 C4 1 4 1 4 1 Z " fill="#000000" transform="translate(395,168)"/>
<path d="M0 0 C4 1 4 1 4 1 Z " fill="#000000" transform="translate(250,139)"/>
<path d="M0 0 C4 1 4 1 4 1 Z " fill="#000000" transform="translate(153,136)"/>
<path d="M0 0 C4 1 4 1 4 1 Z " fill="#000000" transform="translate(147,133)"/>
<path d="M0 0 C1 4 1 4 1 4 Z " fill="#000000" transform="translate(73,127)"/>
<path d="M0 0 C1 4 1 4 1 4 Z " fill="#000000" transform="translate(75,118)"/>
<path d="M0 0 C1 4 1 4 1 4 Z " fill="#000000" transform="translate(77,111)"/>
<path d="M0 0 C4 1 4 1 4 1 Z " fill="#000000" transform="translate(365,97)"/>
<path d="M0 0 C4 1 4 1 4 1 Z " fill="#000000" transform="translate(170,78)"/>
<path d="M0 0 C0.66 0.33 1.32 0.66 2 1 C1.01 1 0.02 1 -1 1 C-0.67 0.67 -0.34 0.34 0 0 Z " fill="#000000" transform="translate(116,35)"/>
<path d="M0 0 C3 1 3 1 3 1 Z " fill="#000000" transform="translate(146,478)"/>
<path d="M0 0 C3 1 3 1 3 1 Z " fill="#000000" transform="translate(184,475)"/>
<path d="M0 0 C3 1 3 1 3 1 Z " fill="#000000" transform="translate(189,472)"/>
<path d="M0 0 C3 1 3 1 3 1 Z " fill="#000000" transform="translate(134,472)"/>
<path d="M0 0 C3 1 3 1 3 1 Z " fill="#000000" transform="translate(172,406)"/>
<path d="M0 0 C3 1 3 1 3 1 Z " fill="#000000" transform="translate(150,406)"/>
<path d="M0 0 C3 1 3 1 3 1 Z " fill="#000000" transform="translate(180,402)"/>
<path d="M0 0 C3 1 3 1 3 1 Z " fill="#000000" transform="translate(142,402)"/>
<path d="M0 0 C3 1 3 1 3 1 Z " fill="#000000" transform="translate(396,389)"/>
<path d="M0 0 C3 1 3 1 3 1 Z " fill="#000000" transform="translate(364,389)"/>
<path d="M0 0 C3 1 3 1 3 1 Z " fill="#000000" transform="translate(352,383)"/>
<path d="M0 0 C3 1 3 1 3 1 Z " fill="#000000" transform="translate(349,382)"/>
<path d="M0 0 C3 1 3 1 3 1 Z " fill="#000000" transform="translate(413,379)"/>
<path d="M0 0 C3 1 3 1 3 1 Z " fill="#000000" transform="translate(344,379)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="M0 0 C3 1 3 1 3 1 Z " fill="#000000" transform="translate(374,167)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="M0 0 C3 1 3 1 3 1 Z " fill="#000000" transform="translate(224,127)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="M0 0 C3 1 3 1 3 1 Z " fill="#000000" transform="translate(242,122)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="M0 0 C3 1 3 1 3 1 Z " fill="#000000" transform="translate(250,104)"/>
<path d="M0 0 C3 1 3 1 3 1 Z " fill="#000000" transform="translate(358,101)"/>
<path d="M0 0 C3 1 3 1 3 1 Z " fill="#000000" transform="translate(246,101)"/>
<path d="M0 0 C3 1 3 1 3 1 Z " fill="#000000" transform="translate(241,98)"/>
<path d="M0 0 C3 1 3 1 3 1 Z " fill="#000000" transform="translate(398,95)"/>
<path d="M0 0 C3 1 3 1 3 1 Z " fill="#000000" transform="translate(369,95)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="M0 0 C3 1 3 1 3 1 Z " fill="#000000" transform="translate(174,77)"/>
<path d="M0 0 C3 1 3 1 3 1 Z " fill="#000000" transform="translate(169,71)"/>
<path d="M0 0 C3 1 3 1 3 1 Z " fill="#000000" transform="translate(220,59)"/>
<path d="M0 0 C0.33 0.66 0.66 1.32 1 2 C0.34 1.67 -0.32 1.34 -1 1 C-0.67 0.67 -0.34 0.34 0 0 Z " fill="#000000" transform="translate(214,54)"/>
<path d="M0 0 C3 1 3 1 3 1 Z " fill="#000000" transform="translate(179,25)"/>
<path d="M0 0 C3 1 3 1 3 1 Z " fill="#000000" transform="translate(127,25)"/>
<path d="M0 0 C3 1 3 1 3 1 Z " fill="#000000" transform="translate(168,19)"/>
<path d="M0 0 C2 1 2 1 2 1 Z " fill="#000000" transform="translate(139,475)"/>
<path d="M0 0 C2 1 2 1 2 1 Z " fill="#000000" transform="translate(131,469)"/>
<path d="M0 0 C2 1 2 1 2 1 Z " fill="#000000" transform="translate(129,468)"/>
<path d="M0 0 C2 1 2 1 2 1 Z " fill="#000000" transform="translate(125,465)"/>
<path d="M0 0 C2 1 2 1 2 1 Z " fill="#000000" transform="translate(202,462)"/>
<path d="M0 0 C2 1 2 1 2 1 Z " fill="#000000" transform="translate(122,462)"/>
<path d="M0 0 C2 1 2 1 2 1 Z " fill="#000000" transform="translate(118,458)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="M0 0 C2 1 2 1 2 1 Z " fill="#000000" transform="translate(191,392)"/>
<path d="M0 0 C2 1 2 1 2 1 Z " fill="#000000" transform="translate(133,392)"/>
<path d="M0 0 C2 1 2 1 2 1 Z " fill="#000000" transform="translate(361,388)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="M0 0 C2 1 2 1 2 1 Z " fill="#000000" transform="translate(355,385)"/>
<path d="M0 0 C2 1 2 1 2 1 Z " fill="#000000" transform="translate(339,375)"/>
<path d="M0 0 C2 1 2 1 2 1 Z " fill="#000000" transform="translate(336,372)"/>
<path d="M0 0 C2 1 2 1 2 1 Z " fill="#000000" transform="translate(334,371)"/>
<path d="M0 0 C2 1 2 1 2 1 Z " fill="#000000" transform="translate(332,369)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="M0 0 C2 1 2 1 2 1 Z " fill="#000000" transform="translate(321,358)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="M0 0 C2 1 2 1 2 1 Z " fill="#000000" transform="translate(395,316)"/>
<path d="M0 0 C2 1 2 1 2 1 Z " fill="#000000" transform="translate(397,315)"/>
<path d="M0 0 C2 1 2 1 2 1 Z " fill="#000000" transform="translate(399,313)"/>
<path d="M0 0 C2 1 2 1 2 1 Z " fill="#000000" transform="translate(359,313)"/>
<path d="M0 0 C2 1 2 1 2 1 Z " fill="#000000" transform="translate(357,312)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="M0 0 C2 1 2 1 2 1 Z " fill="#000000" transform="translate(403,309)"/>
<path d="M0 0 C2 1 2 1 2 1 Z " fill="#000000" transform="translate(353,309)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="M0 0 C2 1 2 1 2 1 Z " fill="#000000" transform="translate(351,308)"/>
<path d="M0 0 C2 1 2 1 2 1 Z " fill="#000000" transform="translate(349,306)"/>
<path d="M0 0 C2 1 2 1 2 1 Z " fill="#000000" transform="translate(347,305)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="M0 0 C2 1 2 1 2 1 Z " fill="#000000" transform="translate(330,285)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="M0 0 C2 1 2 1 2 1 Z " fill="#000000" transform="translate(348,188)"/>
<path d="M0 0 C2 1 2 1 2 1 Z " fill="#000000" transform="translate(357,178)"/>
<path d="M0 0 C2 1 2 1 2 1 Z " fill="#000000" transform="translate(361,175)"/>
<path d="M0 0 C2 1 2 1 2 1 Z " fill="#000000" transform="translate(364,172)"/>
<path d="M0 0 C2 1 2 1 2 1 Z " fill="#000000" transform="translate(366,171)"/>
<path d="M0 0 C2 1 2 1 2 1 Z " fill="#000000" transform="translate(393,167)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="M0 0 C2 1 2 1 2 1 Z " fill="#000000" transform="translate(263,144)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="M0 0 C2 1 2 1 2 1 Z " fill="#000000" transform="translate(253,130)"/>
<path d="M0 0 C2 1 2 1 2 1 Z " fill="#000000" transform="translate(222,129)"/>
<path d="M0 0 C2 1 2 1 2 1 Z " fill="#000000" transform="translate(141,129)"/>
<path d="M0 0 C2 1 2 1 2 1 Z " fill="#000000" transform="translate(139,127)"/>
<path d="M0 0 C2 1 2 1 2 1 Z " fill="#000000" transform="translate(248,126)"/>
<path d="M0 0 C2 1 2 1 2 1 Z " fill="#000000" transform="translate(137,126)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="M0 0 C2 1 2 1 2 1 Z " fill="#000000" transform="translate(333,122)"/>
<path d="M0 0 C2 1 2 1 2 1 Z " fill="#000000" transform="translate(132,122)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="M0 0 C2 1 2 1 2 1 Z " fill="#000000" transform="translate(340,115)"/>
<path d="M0 0 C2 1 2 1 2 1 Z " fill="#000000" transform="translate(421,112)"/>
<path d="M0 0 C2 1 2 1 2 1 Z " fill="#000000" transform="translate(343,112)"/>
<path d="M0 0 C2 1 2 1 2 1 Z " fill="#000000" transform="translate(260,111)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="M0 0 C2 1 2 1 2 1 Z " fill="#000000" transform="translate(417,108)"/>
<path d="M0 0 C2 1 2 1 2 1 Z " fill="#000000" transform="translate(348,108)"/>
<path d="M0 0 C2 1 2 1 2 1 Z " fill="#000000" transform="translate(257,108)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="M0 0 C2 1 2 1 2 1 Z " fill="#000000" transform="translate(414,105)"/>
<path d="M0 0 C2 1 2 1 2 1 Z " fill="#000000" transform="translate(253,105)"/>
<path d="M0 0 C2 1 2 1 2 1 Z " fill="#000000" transform="translate(410,102)"/>
<path d="M0 0 C2 1 2 1 2 1 Z " fill="#000000" transform="translate(356,102)"/>
<path d="M0 0 C2 1 2 1 2 1 Z " fill="#000000" transform="translate(408,101)"/>
<path d="M0 0 C2 1 2 1 2 1 Z " fill="#000000" transform="translate(406,100)"/>
<path d="M0 0 C2 1 2 1 2 1 Z " fill="#000000" transform="translate(361,100)"/>
<path d="M0 0 C2 1 2 1 2 1 Z " fill="#000000" transform="translate(244,100)"/>
<path d="M0 0 C2 1 2 1 2 1 Z " fill="#000000" transform="translate(404,98)"/>
<path d="M0 0 C2 1 2 1 2 1 Z " fill="#000000" transform="translate(363,98)"/>
<path d="M0 0 C2 1 2 1 2 1 Z " fill="#000000" transform="translate(168,77)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="M0 0 C2 1 2 1 2 1 Z " fill="#000000" transform="translate(167,70)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="M0 0 C2 1 2 1 2 1 Z " fill="#000000" transform="translate(225,63)"/>
<path d="M0 0 C2 1 2 1 2 1 Z " fill="#000000" transform="translate(218,57)"/>
<path d="M0 0 C2 1 2 1 2 1 Z " fill="#000000" transform="translate(216,56)"/>
<path d="M0 0 C2 1 2 1 2 1 Z " fill="#000000" transform="translate(211,53)"/>
<path d="M0 0 C2 1 2 1 2 1 Z " fill="#000000" transform="translate(209,52)"/>
<path d="M0 0 C2 1 2 1 2 1 Z " fill="#000000" transform="translate(207,50)"/>
<path d="M0 0 C2 1 2 1 2 1 Z " fill="#000000" transform="translate(205,49)"/>
<path d="M0 0 C2 1 2 1 2 1 Z " fill="#000000" transform="translate(202,46)"/>
<path d="M0 0 C2 1 2 1 2 1 Z " fill="#000000" transform="translate(200,45)"/>
<path d="M0 0 C2 1 2 1 2 1 Z " fill="#000000" transform="translate(195,39)"/>
<path d="M0 0 C2 1 2 1 2 1 Z " fill="#000000" transform="translate(191,35)"/>
<path d="M0 0 C2 1 2 1 2 1 Z " fill="#000000" transform="translate(189,33)"/>
<path d="M0 0 C2 1 2 1 2 1 Z " fill="#000000" transform="translate(187,32)"/>
<path d="M0 0 C2 1 2 1 2 1 Z " fill="#000000" transform="translate(119,32)"/>
<path d="M0 0 C2 1 2 1 2 1 Z " fill="#000000" transform="translate(183,28)"/>
<path d="M0 0 C2 1 2 1 2 1 Z " fill="#000000" transform="translate(124,28)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
<path d="" fill="#000000" transform="translate(0,0)"/>
</svg>

  );
}

// --- Login Screen Component (Clean, Authentic Enterprise Login) ---
function LoginScreen({ onLoginSuccess, showToast }) {
  const [email, setEmail] = useState('');
  const [password, setPassword] = useState('');
  const [isPasswordVisible, setIsPasswordVisible] = useState(false);
  const [rememberMe, setRememberMe] = useState(true);
  const [isLoading, setIsLoading] = useState(false);
  const [errorMessage, setErrorMessage] = useState(null);

  // Live domain / staff feedback (subtle)
  const isStaffDomain = useMemo(() => {
    const trimmed = (email || '').trim().toLowerCase();
    return trimmed.endsWith('@sneksoft.dev') || trimmed.endsWith('@rizewolf.com') || trimmed.includes('admin');
  }, [email]);

  const handleSubmit = async (e) => {
    if (e) e.preventDefault();
    if (!email.trim() || !password) {
      setErrorMessage('Please enter both your email address and password.');
      chimeEngine.playAlert();
      return;
    }

    setIsLoading(true);
    setErrorMessage(null);
    chimeEngine.playPop();

    try {
      const res = await fetch('/api/v1/auth/login', {
        method: 'POST',
        headers: { 'Content-Type': 'application/json' },
        body: JSON.stringify({ email: email.trim(), password })
      });
      const data = await res.json();

      if (res.ok && data.status === 'success') {
        if (rememberMe) {
          localStorage.setItem('sneksoft_token', data.token);
          localStorage.setItem('sneksoft_user', JSON.stringify(data.user));
        }
        chimeEngine.playSuccess();
        if (window.confetti) {
          window.confetti({ particleCount: 75, spread: 85, origin: { y: 0.7 } });
        }
        showToast(data.message || `Welcome back, ${data.user.displayName}!`, 'success');
        onLoginSuccess(data.user, data.token);
      } else {
        setErrorMessage(data.message || 'Sign in failed. Please check your email and password.');
        chimeEngine.playAlert();
      }
    } catch (err) {
      setErrorMessage('Network error connecting to auth service.');
      chimeEngine.playAlert();
    } finally {
      setIsLoading(false);
    }
  };

  const handleForgotPassword = async () => {
    if (!email.trim()) {
      setErrorMessage('Please enter your email above to receive password reset instructions.');
      chimeEngine.playAlert();
      return;
    }

    try {
      const res = await fetch('/api/v1/auth/reset-password', {
        method: 'POST',
        headers: { 'Content-Type': 'application/json' },
        body: JSON.stringify({ email: email.trim() })
      });
      const data = await res.json();
      showToast(data.message || 'Password reset link dispatched.', 'info');
      setErrorMessage(null);
      chimeEngine.playDing();
    } catch (e) {
      setErrorMessage('Failed to send reset email.');
    }
  };

  return (
    <div className="login-screen-wrapper">
      {/* Scenic Background with subtle glow */}
      <div className="scenic-login-bg"></div>
      <div className="scenic-login-overlay"></div>
      <div className="scenic-orb scenic-orb-1"></div>
      <div className="scenic-orb scenic-orb-2"></div>

      <div className="login-container">
        {/* Sneksoft Infinity Logo & Header */}
        <SneksoftLogo />
        <h1 className="login-brand-title">SN3KB1TE</h1>
        <div className="login-pill-badge">CLIENT & STAFF PORTAL</div>

        {/* Clean, Fully Visible Login Card */}
        <div className="login-card" style={{ maxWidth: '440px' }}>
          <div className="login-card-header" style={{ marginBottom: '20px' }}>
            <h2 style={{ fontSize: '22px', fontWeight: '800' }}>Sign In</h2>
            <p style={{ fontSize: '13px' }}>Enter your credentials to access your deliverables & tasks</p>
          </div>

          {errorMessage && (
            <div style={{ background: '#FEE2E2', border: '1px solid #FCA5A5', color: '#991B1B', padding: '12px 14px', borderRadius: '12px', fontSize: '13px', fontWeight: '500', display: 'flex', alignItems: 'center', gap: '8px', marginBottom: '16px', animation: 'fadeIn 0.2s ease' }}>
              <span className="icon" style={{ fontSize: '18px', color: '#DC2626' }}>error</span>
              <span>{errorMessage}</span>
            </div>
          )}

          <form onSubmit={handleSubmit} style={{ display: 'flex', flexDirection: 'column', gap: '16px' }}>
            {/* Email Field */}
            <div className="login-field">
              <div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}>
                <label style={{ color: '#E2E8F0', fontWeight: '600', fontSize: '13px' }}>Email Address</label>
                {isStaffDomain && (
                  <span style={{ fontSize: '10px', fontWeight: '700', color: '#10B981', background: 'rgba(16, 185, 129, 0.15)', padding: '2px 6px', borderRadius: '4px' }}>
                    Staff Domain
                  </span>
                )}
              </div>
              <div className="login-input-wrap">
                <span className="icon field-icon">mail</span>
                <input
                  type="email"
                  placeholder="name@company.com"
                  value={email}
                  onChange={(e) => setEmail(e.target.value)}
                  required
                  autoFocus
                />
              </div>
            </div>

            {/* Password Field */}
            <div className="login-field">
              <div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}>
                <label style={{ color: '#E2E8F0', fontWeight: '600', fontSize: '13px' }}>Password</label>
                <button
                  type="button"
                  onClick={handleForgotPassword}
                  style={{ background: 'none', border: 'none', color: '#10B981', fontSize: '12px', fontWeight: '600', cursor: 'pointer', padding: 0 }}
                >
                  Forgot password?
                </button>
              </div>
              <div className="login-input-wrap">
                <span className="icon field-icon">lock</span>
                <input
                  type={isPasswordVisible ? 'text' : 'password'}
                  placeholder="Enter your password"
                  value={password}
                  onChange={(e) => setPassword(e.target.value)}
                  required
                />
                <button
                  type="button"
                  className="toggle-eye-btn"
                  onClick={() => setIsPasswordVisible(!isPasswordVisible)}
                  title={isPasswordVisible ? 'Hide Password' : 'Show Password'}
                >
                  <span className="icon">{isPasswordVisible ? 'visibility_off' : 'visibility'}</span>
                </button>
              </div>
            </div>

            {/* Remember Me */}
            <div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', padding: '2px 0' }}>
              <label style={{ display: 'flex', alignItems: 'center', gap: '8px', cursor: 'pointer', fontSize: '13px', color: 'var(--text-muted)' }}>
                <input
                  type="checkbox"
                  checked={rememberMe}
                  onChange={(e) => setRememberMe(e.target.checked)}
                  style={{ accentColor: '#10B981', width: '16px', height: '16px', cursor: 'pointer' }}
                />
                <span>Remember me</span>
              </label>
              <span style={{ fontSize: '11px', color: 'var(--text-subtle)', display: 'flex', alignItems: 'center', gap: '4px' }}>
                <span className="icon" style={{ fontSize: '14px', color: '#10B981' }}>verified_user</span>
                <span>Encrypted & Secure</span>
              </span>
            </div>

            {/* Submit Button */}
            <button type="submit" className="btn-thick-emerald" disabled={isLoading} style={{ marginTop: '4px' }}>
              {isLoading ? (
                <>
                  <span className="icon" style={{ animation: 'spin 1s linear infinite' }}>sync</span>
                  <span>Signing In...</span>
                </>
              ) : (
                <>
                  <span>Sign In</span>
                  <span className="icon">arrow_forward</span>
                </>
              )}
            </button>
          </form>
        </div>
      </div>
    </div>
  );
}

// --- Route & URL History Helpers ---
function getRouteFromLocation() {
  if (typeof window === 'undefined') return { tab: 'dashboard', subId: null };
  const path = window.location.pathname.replace(/^\/+/, '').toLowerCase();
  const hash = window.location.hash.replace(/^#\/?/, '').toLowerCase();
  const raw = path || hash || 'dashboard';
  const segments = raw.split('/').filter(Boolean);
  let mainTab = segments[0] || 'dashboard';
  if (mainTab === 'crm') mainTab = 'clients';
  const subId = segments[1] || null;

  const validTabs = ['dashboard', 'projects', 'deliverables', 'tasks', 'clients', 'staff', 'messages', 'analytics', 'webhooks', 'health', 'profile'];
  if (validTabs.includes(mainTab)) {
    return { tab: mainTab, subId };
  }
  return { tab: 'dashboard', subId: null };
}

// --- Main App Component ---
function App() {
  // Authentication State
  const [currentUser, setCurrentUser] = useState(() => {
    try {
      const stored = localStorage.getItem('sneksoft_user');
      return stored ? JSON.parse(stored) : null;
    } catch (e) {
      return null;
    }
  });
  const [authToken, setAuthToken] = useState(() => localStorage.getItem('sneksoft_token'));
  const [isUserMenuOpen, setIsUserMenuOpen] = useState(false);
  const [isSidebarCollapsed, setIsSidebarCollapsed] = useState(false);

  // Individual Page Routing with Browser History
  const initialRoute = useMemo(() => getRouteFromLocation(), []);
  const [activeTab, setActiveTab] = useState(initialRoute.tab);
  const [soundEnabled, setSoundEnabled] = useState(true);

  const [selectedProjectId, setSelectedProjectId] = useState('ALL');
  const [searchQuery, setSearchQuery] = useState('');
  const [toast, setToast] = useState(null);

  const [selectedAvatarId, setSelectedAvatarId] = useState(currentUser?.avatarId || 'p1');
  const [customAvatarUrl, setCustomAvatarUrl] = useState('');

  // Data Collections
  const [projects, setProjects] = useState([]);
  const [deliverables, setDeliverables] = useState([]);
  const [tasks, setTasks] = useState([]);
  const [messages, setMessages] = useState([]);
  const [staff, setStaff] = useState([]);
  const [clients, setClients] = useState([]);
  const [webhooks, setWebhooks] = useState([]);
  const [analytics, setAnalytics] = useState(null);

  const [activeProjectDetail, setActiveProjectDetail] = useState(null);
  const [activeProjectTab, setActiveProjectTab] = useState('milestones');

  const [deliverableFilter, setDeliverableFilter] = useState('ALL');
  const [taskFilter, setTaskFilter] = useState('ALL');
  const [clientFilter, setClientFilter] = useState('ALL');
  const [clientTierFilter, setClientTierFilter] = useState('ALL');
  const [clientSearchQuery, setClientSearchQuery] = useState('');
  const [clientStatusFilter, setClientStatusFilter] = useState('ALL');
  const [clientViewMode, setClientViewMode] = useState('grid');
  const [projectCategoryFilter, setProjectCategoryFilter] = useState('ALL');
  const [projectViewMode, setProjectViewMode] = useState('kanban');

  const [modalType, setModalType] = useState(null);
  const [targetDeliverable, setTargetDeliverable] = useState(null);
  const [approvalNote, setApprovalNote] = useState('');
  const [editingClient, setEditingClient] = useState(null);
  const [viewingContractClient, setViewingContractClient] = useState(null);
  const [clientCreationStep, setClientCreationStep] = useState(1);
  const [contractPdfFile, setContractPdfFile] = useState(null);
  const [isDraggingPdf, setIsDraggingPdf] = useState(false);

  // Profile Edit State
  const [profileForm, setProfileForm] = useState({
    displayName: currentUser?.displayName || 'Client Representative',
    email: currentUser?.email || 'sarah.jenkins@sneksoft.com',
    phone: '(303) 555-0105',
    address: 'UK, 789 Pine Avenue',
    occupation: currentUser?.title || 'Executive Business Leader',
    company: currentUser?.company || 'Enterprise Client'
  });

  const [projectForm, setProjectForm] = useState({
    title: '',
    clientName: '',
    category: 'Mobile App Development',
    description: '',
    deadline: 'Dec 2026',
    progress: 15,
    accentColorHex: '#0284C7'
  });

  const [clientForm, setClientForm] = useState({
    company: '',
    primaryContact: '',
    email: '',
    phone: '',
    industry: 'Enterprise Software & Cloud',
    tier: 'ENTERPRISE',
    status: 'ACTIVE',
    billingStatus: 'CURRENT',
    monthlyRetainer: '$18,500/mo',
    contractStart: new Date().toISOString().split('T')[0],
    contractEnd: '2026-12-31',
    contractPdfName: 'Enterprise_Master_Services_Agreement_2026.pdf',
    contractPdfSize: '2.4 MB',
    contractPdfUrl: '',
    contractType: 'Master Services Agreement (MSA)',
    slaTier: '24/7 Dedicated Architecture Team (1hr SLA)',
    ndaSigned: true,
    notes: '',
    assignedProjects: []
  });

  const [deliverableForm, setDeliverableForm] = useState({
    projectId: '1',
    title: '',
    fileType: 'APK',
    fileDetails: 'Android Staging Build (SHA-256 Verified)',
    downloadUrl: 'https://builds.sneksoft.com/app-staging-v2.5.0.apk',
    buildNumber: '2.5.0',
    changelog: 'Added real-time notification chimes and passkey security flow.',
    submittedBy: currentUser?.displayName || 'Alex Chen (Staff Lead)'
  });

  const [taskForm, setTaskForm] = useState({
    projectId: '1',
    title: '',
    description: '',
    assignedToRole: 'CLIENT',
    assignedToName: 'Client Lead',
    dueDate: 'Tomorrow at 5:00 PM',
    priority: 'HIGH'
  });

  const [staffForm, setStaffForm] = useState({
    name: '',
    email: '',
    role: 'Staff Engineer',
    accessLevel: 'STAFF_ENGINEER',
    isPasskeyEnrolled: true
  });

  const [assignStaffForm, setAssignStaffForm] = useState({
    staffId: '',
    role: 'Lead Architect & Engineer'
  });

  const [chatMessage, setChatMessage] = useState('');
  const [pushPermission, setPushPermission] = useState(() => {
    return (typeof window !== 'undefined' && 'Notification' in window) ? Notification.permission : 'default';
  });
  const [messageSearch, setMessageSearch] = useState('');
  const [selectedChannelId, setSelectedChannelId] = useState('ALL');
  const [attachedDeliverableWeb, setAttachedDeliverableWeb] = useState(null);
  const [reactions, setReactions] = useState({});
  const [isStaffTyping, setIsStaffTyping] = useState(false);

  const requestPushPermission = async () => {
    if (typeof window !== 'undefined' && 'Notification' in window) {
      try {
        const permission = await Notification.requestPermission();
        setPushPermission(permission);
        if (permission === 'granted') {
          showToast('Push notifications enabled for Sneksoft Portal!', 'success');
          try {
            new Notification('Sneksoft Client Portal', {
              body: 'Push notifications are active. You will receive real-time updates for messages and deliverables.',
              icon: '/images/login_bg.png'
            });
          } catch (e) {}
        } else {
          showToast('Notification permission: ' + permission, 'info');
        }
      } catch (e) {
        showToast('Could not request notification permissions.', 'warning');
      }
    } else {
      showToast('Notifications are not supported in this browser.', 'warning');
    }
  };

  const triggerPushAlert = (title, body) => {
    if (typeof window !== 'undefined' && 'Notification' in window && Notification.permission === 'granted') {
      try {
        new Notification(title, {
          body: body,
          icon: '/images/login_bg.png'
        });
      } catch (err) {
        console.warn('Push alert error:', err);
      }
    }
  };

  useEffect(() => {
    chimeEngine.enabled = soundEnabled;
  }, [soundEnabled]);

  const showToast = (message, type = 'info') => {
    setToast({ message, type, id: Date.now() });
    if (type === 'success') {
      chimeEngine.playSuccess();
      if (window.confetti) {
        window.confetti({ particleCount: 50, spread: 70, origin: { y: 0.8 } });
      }
    } else if (type === 'warning') {
      chimeEngine.playAlert();
    } else {
      chimeEngine.playDing();
    }
    setTimeout(() => setToast(null), 3500);
  };

  // Authenticated Data Sync with Real-time SSE Stream
  const fetchData = useCallback(async () => {
    if (!currentUser) return;
    const headers = {};
    if (authToken) headers['Authorization'] = `Bearer ${authToken}`;

    try {
      const [pRes, dRes, tRes, mRes, sRes, cRes, wRes, aRes] = await Promise.all([
        fetch('/api/v1/projects', { headers }).then(r => r.json()),
        fetch('/api/v1/deliverables', { headers }).then(r => r.json()),
        fetch('/api/v1/tasks', { headers }).then(r => r.json()),
        fetch('/api/v1/messages', { headers }).then(r => r.json()),
        fetch('/api/v1/staff', { headers }).then(r => r.json()),
        fetch('/api/v1/clients', { headers }).then(r => r.json()),
        fetch('/api/v1/webhooks', { headers }).then(r => r.json()),
        fetch('/api/v1/analytics', { headers }).then(r => r.json())
      ]);

      if (pRes.projects) {
        setProjects(pRes.projects);
        // Keep active project in sync
        setActiveProjectDetail(prev => {
          if (!prev) return pRes.projects[0] || null;
          const updated = pRes.projects.find(p => String(p.id) === String(prev.id));
          return updated || pRes.projects[0] || null;
        });
      }
      if (dRes.deliverables) setDeliverables(dRes.deliverables);
      if (tRes.tasks) setTasks(tRes.tasks);
      if (mRes.messages) setMessages(mRes.messages);
      if (sRes.staff) setStaff(sRes.staff);
      if (cRes.clients && Array.isArray(cRes.clients)) {
        setClients(cRes.clients);
      } else {
        setClients([]);
      }
      if (wRes.webhooks) setWebhooks(wRes.webhooks);
      if (aRes.system) setAnalytics(aRes);
    } catch (err) {
      console.error('Failed to sync backend data:', err);
    }
  }, [currentUser, authToken]);

  // Real-time synchronization via Server-Sent Events (SSE)
  useEffect(() => {
    if (!currentUser) return;
    fetchData();

    let eventSource;
    try {
      eventSource = new EventSource('/api/v1/events');
      eventSource.onmessage = (e) => {
        try {
          const payload = JSON.parse(e.data);
          if (payload.type && payload.type !== 'CONNECTED') {
            console.log('⚡ Real-time SSE event received from backend:', payload.type);
            fetchData();
          }
        } catch (err) {
          console.error('SSE payload parse error:', err);
        }
      };
      eventSource.onerror = (err) => {
        // SSE auto-reconnects
      };
    } catch (err) {
      console.warn('SSE subscription fallback:', err);
    }

    const interval = setInterval(fetchData, 6000);
    return () => {
      clearInterval(interval);
      if (eventSource) eventSource.close();
    };
  }, [currentUser, fetchData]);

  // Dedicated Page Navigation & Browser History Sync (Back / Forward navigation)
  const navigateTo = useCallback((tab, subId = null, replace = false) => {
    const normalizedTab = tab === 'crm' ? 'clients' : tab;
    setActiveTab(normalizedTab);

    if (normalizedTab === 'projects' && subId && projects.length > 0) {
      const proj = projects.find(p => String(p.id) === String(subId));
      if (proj) setActiveProjectDetail(proj);
    }

    let urlPath = `/${normalizedTab === 'dashboard' && !subId ? '' : normalizedTab}`;
    if (subId) urlPath += `/${subId}`;
    if (urlPath === '') urlPath = '/';

    const pageTitles = {
      dashboard: 'Sneksoft • Overview Dashboard',
      projects: subId ? 'Sneksoft • Project Details' : 'Sneksoft • Projects Hub',
      deliverables: 'Sneksoft • Deliverables & Builds',
      tasks: 'Sneksoft • Action Items & Tasks',
      clients: 'Sneksoft • CRM & Contracts',
      staff: 'Sneksoft • Staff Directory',
      messages: 'Sneksoft • Team Discussions',
      analytics: 'Sneksoft • Analytics & Audits',
      webhooks: 'Sneksoft • Webhooks & Events',
      health: 'Sneksoft • System Diagnostics',
      profile: 'Sneksoft • Profile & Preferences'
    };
    document.title = pageTitles[normalizedTab] || 'Sneksoft Client Portal';

    try {
      if (window.location.pathname !== urlPath) {
        if (replace) {
          window.history.replaceState({ tab: normalizedTab, subId }, '', urlPath);
        } else {
          window.history.pushState({ tab: normalizedTab, subId }, '', urlPath);
        }
      }
    } catch (e) {
      const hashPath = subId ? `#/${normalizedTab}/${subId}` : `#/${normalizedTab}`;
      if (window.location.hash !== hashPath) {
        if (replace) window.location.replace(hashPath);
        else window.location.hash = hashPath;
      }
    }
  }, [projects]);

  // Handle browser Back / Forward history navigation (popstate & hashchange)
  useEffect(() => {
    const handleLocationChange = () => {
      const route = getRouteFromLocation();
      setActiveTab(route.tab);
      if (route.subId && projects.length > 0) {
        const found = projects.find(p => String(p.id) === String(route.subId));
        if (found) setActiveProjectDetail(found);
      }

      const pageTitles = {
        dashboard: 'Sneksoft • Overview Dashboard',
        projects: route.subId ? 'Sneksoft • Project Details' : 'Sneksoft • Projects Hub',
        deliverables: 'Sneksoft • Deliverables & Builds',
        tasks: 'Sneksoft • Action Items & Tasks',
        clients: 'Sneksoft • CRM & Contracts',
        staff: 'Sneksoft • Staff Directory',
        messages: 'Sneksoft • Team Discussions',
        analytics: 'Sneksoft • Analytics & Audits',
        webhooks: 'Sneksoft • Webhooks & Events',
        health: 'Sneksoft • System Diagnostics',
        profile: 'Sneksoft • Profile & Preferences'
      };
      document.title = pageTitles[route.tab] || 'Sneksoft Client Portal';
    };

    window.addEventListener('popstate', handleLocationChange);
    window.addEventListener('hashchange', handleLocationChange);

    // Initial sync when projects list is populated
    if (initialRoute.subId && projects.length > 0) {
      const found = projects.find(p => String(p.id) === String(initialRoute.subId));
      if (found) setActiveProjectDetail(found);
    }

    return () => {
      window.removeEventListener('popstate', handleLocationChange);
      window.removeEventListener('hashchange', handleLocationChange);
    };
  }, [projects, initialRoute]);

  // Auth Handlers
  const handleLoginSuccess = (user, token) => {
    setCurrentUser(user);
    setAuthToken(token);
    setSelectedAvatarId(user.avatarId || 'p1');
    setProfileForm({
      displayName: user.displayName,
      email: user.email,
      phone: '(303) 555-0105',
      address: 'UK, 789 Pine Avenue',
      occupation: user.title,
      company: user.company || 'Enterprise Client'
    });
    const currentRoute = getRouteFromLocation();
    navigateTo(currentRoute.tab, currentRoute.subId, true);
  };

  const handleLogout = async () => {
    chimeEngine.playAlert();
    try {
      if (authToken) {
        await fetch('/api/v1/auth/logout', {
          method: 'POST',
          headers: { 'Authorization': `Bearer ${authToken}` }
        });
      }
    } catch (e) {
      // ignore
    }

    localStorage.removeItem('sneksoft_token');
    localStorage.removeItem('sneksoft_user');
    setCurrentUser(null);
    setAuthToken(null);
    setIsUserMenuOpen(false);
    showToast('Signed out of Sneksoft Portal', 'info');
  };

  // Filters & Calculations
  const filteredProjects = useMemo(() => {
    return projects.filter(p => {
      const q = (searchQuery || '').toLowerCase();
      const matchesSearch = (p.title || '').toLowerCase().includes(q) ||
                            (p.clientName || '').toLowerCase().includes(q) ||
                            (p.category || '').toLowerCase().includes(q) ||
                            (p.description || '').toLowerCase().includes(q);
      const matchesProject = selectedProjectId === 'ALL' || String(p.id) === String(selectedProjectId);
      const matchesCategory = projectCategoryFilter === 'ALL' || p.category === projectCategoryFilter;
      return matchesSearch && matchesProject && matchesCategory;
    });
  }, [projects, searchQuery, selectedProjectId, projectCategoryFilter]);

  const filteredDeliverables = useMemo(() => {
    return deliverables.filter(d => {
      const matchesSearch = d.title.toLowerCase().includes(searchQuery.toLowerCase()) ||
                            d.fileType.toLowerCase().includes(searchQuery.toLowerCase());
      const matchesProject = selectedProjectId === 'ALL' || String(d.projectId) === String(selectedProjectId);

      let matchesFilter = true;
      if (deliverableFilter === 'PENDING') matchesFilter = d.status === 'PENDING_APPROVAL';
      if (deliverableFilter === 'APPROVED') matchesFilter = d.status === 'APPROVED';
      if (deliverableFilter === 'CHANGES') matchesFilter = d.status === 'CHANGES_REQUESTED';
      if (deliverableFilter === 'APK') matchesFilter = d.fileType === 'APK';
      if (deliverableFilter === 'FIGMA') matchesFilter = d.fileType === 'FIGMA';

      return matchesSearch && matchesProject && matchesFilter;
    });
  }, [deliverables, searchQuery, selectedProjectId, deliverableFilter]);

  const filteredTasks = useMemo(() => {
    return tasks.filter(t => {
      const matchesSearch = t.title.toLowerCase().includes(searchQuery.toLowerCase()) ||
                            t.description.toLowerCase().includes(searchQuery.toLowerCase()) ||
                            t.assignedToName.toLowerCase().includes(searchQuery.toLowerCase());
      const matchesProject = selectedProjectId === 'ALL' || String(t.projectId) === String(selectedProjectId);

      let matchesFilter = true;
      if (taskFilter === 'PENDING') matchesFilter = !t.isCompleted;
      if (taskFilter === 'COMPLETED') matchesFilter = t.isCompleted;
      if (taskFilter === 'HIGH') matchesFilter = t.priority === 'HIGH';
      if (taskFilter === 'CLIENT') matchesFilter = t.assignedToRole === 'CLIENT';
      if (taskFilter === 'STAFF') matchesFilter = t.assignedToRole === 'STAFF';

      return matchesSearch && matchesProject && matchesFilter;
    });
  }, [tasks, searchQuery, selectedProjectId, taskFilter]);

  const filteredClients = useMemo(() => {
    return (clients || []).filter(c => {
      const q = (clientSearchQuery || '').toLowerCase().trim();
      const matchesSearch = !q || (c.company || '').toLowerCase().includes(q) ||
                            (c.primaryContact || '').toLowerCase().includes(q) ||
                            (c.email || '').toLowerCase().includes(q) ||
                            (c.industry || '').toLowerCase().includes(q) ||
                            (c.tier || '').toLowerCase().includes(q);

      let matchesStatus = true;
      if (clientStatusFilter !== 'ALL') {
        matchesStatus = c.status === clientStatusFilter;
      } else if (clientFilter !== 'ALL') {
        matchesStatus = c.status === clientFilter;
      }

      let matchesTier = true;
      if (clientTierFilter !== 'ALL') matchesTier = c.tier === clientTierFilter;

      return matchesSearch && matchesStatus && matchesTier;
    });
  }, [clients, clientSearchQuery, clientFilter, clientStatusFilter, clientTierFilter]);

  const pendingApprovalsCount = useMemo(() => deliverables.filter(d => d.status === 'PENDING_APPROVAL').length, [deliverables]);
  const pendingTasksCount = useMemo(() => tasks.filter(t => !t.isCompleted).length, [tasks]);
  const avgCompletion = useMemo(() => {
    if (!projects.length) return 0;
    return Math.round(projects.reduce((acc, p) => acc + (Number(p.progress) || 0), 0) / projects.length);
  }, [projects]);

  // Handlers for Data Mutations
  const handleCreateProject = async (e) => {
    e.preventDefault();
    try {
      const emailLower = (currentUser?.email || '').trim().toLowerCase();
      const isStaffUser = currentUser?.isStaff || 
        emailLower.endsWith('@sneksoft.dev') || 
        emailLower.endsWith('@rizewolf.com') || 
        currentUser?.isAdmin;

      const payload = {
        ...projectForm,
        creatorEmail: currentUser?.email,
        creatorName: currentUser?.displayName || currentUser?.name,
        creatorRole: currentUser?.role || (emailLower.endsWith('@rizewolf.com') ? 'Principal Security Architect' : 'Staff Lead & Enterprise Architect'),
        creatorId: currentUser?.id || currentUser?.uid
      };

      const res = await fetch('/api/v1/projects', {
        method: 'POST',
        headers: { 'Content-Type': 'application/json', 'Authorization': `Bearer ${authToken}` },
        body: JSON.stringify(payload)
      });
      const data = await res.json();
      if (res.ok) {
        showToast(isStaffUser ? `Project published & automatically assigned to ${currentUser?.displayName || 'you'}!` : 'Client project registered & published!', 'success');
        setModalType(null);
        setProjectForm({ title: '', clientName: '', category: 'Mobile App Development', description: '', deadline: 'Dec 2026', progress: 15, accentColorHex: '#0284C7' });
        fetchData();
      } else {
        showToast(data.message || 'Failed to create project', 'warning');
      }
    } catch (e) {
      showToast('Network error publishing project', 'warning');
    }
  };

  const handleCreateDeliverable = async (e) => {
    e.preventDefault();
    try {
      const res = await fetch('/api/v1/deliverables', {
        method: 'POST',
        headers: { 'Content-Type': 'application/json', 'Authorization': `Bearer ${authToken}` },
        body: JSON.stringify(deliverableForm)
      });
      const data = await res.json();
      if (res.ok) {
        showToast('Deliverable build dispatched to client!', 'success');
        setModalType(null);
        setDeliverableForm({ projectId: '1', title: '', fileType: 'APK', fileDetails: 'Android Staging Build', downloadUrl: 'https://builds.sneksoft.com/app-v2.5.0.apk', buildNumber: '2.5.0', changelog: '', submittedBy: currentUser?.displayName });
        fetchData();
      } else {
        showToast(data.message || 'Failed to publish deliverable', 'warning');
      }
    } catch (e) {
      showToast('Network error publishing deliverable', 'warning');
    }
  };

  const handleUpdateDeliverableStatus = async (id, status, notes = '') => {
    try {
      const res = await fetch(`/api/v1/deliverables/${id}/status`, {
        method: 'PATCH',
        headers: { 'Content-Type': 'application/json', 'Authorization': `Bearer ${authToken}` },
        body: JSON.stringify({ status, notes, reviewedBy: currentUser?.displayName })
      });
      if (res.ok) {
        showToast(`Deliverable marked as ${status.replace('_', ' ')}!`, status === 'APPROVED' ? 'success' : 'info');
        setModalType(null);
        fetchData();
      }
    } catch (e) {
      showToast('Status update failed', 'warning');
    }
  };

  const handleCreateTask = async (e) => {
    e.preventDefault();
    try {
      const res = await fetch('/api/v1/tasks', {
        method: 'POST',
        headers: { 'Content-Type': 'application/json', 'Authorization': `Bearer ${authToken}` },
        body: JSON.stringify(taskForm)
      });
      if (res.ok) {
        showToast('Action item assigned!', 'success');
        setModalType(null);
        setTaskForm({ projectId: '1', title: '', description: '', assignedToRole: 'CLIENT', assignedToName: 'Client Lead', dueDate: 'Tomorrow at 5:00 PM', priority: 'HIGH' });
        fetchData();
      }
    } catch (e) {
      showToast('Task creation failed', 'warning');
    }
  };

  const handleToggleTask = async (id, currentStatus) => {
    try {
      const res = await fetch(`/api/v1/tasks/${id}/toggle`, {
        method: 'PATCH',
        headers: { 'Content-Type': 'application/json', 'Authorization': `Bearer ${authToken}` },
        body: JSON.stringify({ isCompleted: !currentStatus })
      });
      if (res.ok) {
        showToast(!currentStatus ? 'Task completed!' : 'Task reopened', !currentStatus ? 'success' : 'info');
        fetchData();
      }
    } catch (e) {
      showToast('Failed to toggle task', 'warning');
    }
  };

  const handleSendMessage = async (e) => {
    e?.preventDefault?.();
    if (!chatMessage.trim()) return;

    const targetProjId = selectedChannelId === 'ALL' ? (selectedProjectId === 'ALL' ? '1' : selectedProjectId) : selectedChannelId;
    const textToSend = attachedDeliverableWeb
      ? `${chatMessage.trim()}\n📎 Attached: ${attachedDeliverableWeb}`
      : chatMessage.trim();

    try {
      const res = await fetch('/api/v1/messages', {
        method: 'POST',
        headers: { 'Content-Type': 'application/json', 'Authorization': `Bearer ${authToken}` },
        body: JSON.stringify({
          projectId: targetProjId,
          senderName: currentUser?.displayName || 'Client Representative',
          senderRole: currentUser?.role || 'CLIENT',
          text: textToSend
        })
      });
      if (res.ok) {
        setChatMessage('');
        setAttachedDeliverableWeb(null);
        chimeEngine.playPop();
        fetchData();
        triggerPushAlert('💬 Message Dispatched', `${currentUser?.displayName || 'You'}: ${chatMessage.trim()}`);

        // Real-time bidirectional staff reply simulation with push notification
        setIsStaffTyping(true);
        setTimeout(async () => {
          setIsStaffTyping(false);
          const replies = [
            'Thanks for the update! Reviewing the build logs and UI specs now.',
            'Acknowledged. The engineering team is preparing the milestone deliverable.',
            'Great question! We have verified the build artifacts and passkey credentials.',
            'Received. Staging deployment is underway for your review.'
          ];
          const autoReply = replies[Math.floor(Math.random() * replies.length)];
          try {
            await fetch('/api/v1/messages', {
              method: 'POST',
              headers: { 'Content-Type': 'application/json', 'Authorization': `Bearer ${authToken}` },
              body: JSON.stringify({
                projectId: targetProjId,
                senderName: 'Alex Chen',
                senderRole: 'STAFF',
                text: autoReply
              })
            });
            fetchData();
            chimeEngine.playDing();
            triggerPushAlert('🔔 New Message from Alex Chen (Staff Lead)', autoReply);
          } catch (err) {}
        }, 2200);
      }
    } catch (e) {
      showToast('Failed to send message', 'warning');
    }
  };

  const handleDeleteMessage = async (msgId) => {
    try {
      const res = await fetch(`/api/v1/messages/${msgId}`, {
        method: 'DELETE',
        headers: { 'Authorization': `Bearer ${authToken}` }
      });
      if (res.ok) {
        showToast('Message removed', 'info');
        fetchData();
      } else {
        setMessages(prev => prev.filter(m => m.id !== msgId));
        showToast('Message removed', 'info');
      }
    } catch (e) {
      setMessages(prev => prev.filter(m => m.id !== msgId));
      showToast('Message removed', 'info');
    }
  };

  const handleReactMessage = (msgId, emoji) => {
    setReactions(prev => {
      const msgReactions = prev[msgId] || {};
      const currentCount = msgReactions[emoji] || 0;
      return {
        ...prev,
        [msgId]: {
          ...msgReactions,
          [emoji]: currentCount + 1
        }
      };
    });
    chimeEngine.playPop();
    showToast(`Reacted ${emoji}`, 'info');
  };

  const handleCreateStaff = async (e) => {
    e.preventDefault();
    try {
      const res = await fetch('/api/v1/staff', {
        method: 'POST',
        headers: { 'Content-Type': 'application/json', 'Authorization': `Bearer ${authToken}` },
        body: JSON.stringify(staffForm)
      });
      if (res.ok) {
        showToast('Staff member enrolled with passkey credentials!', 'success');
        setModalType(null);
        setStaffForm({ name: '', email: '', role: 'Staff Engineer', accessLevel: 'STAFF_ENGINEER', isPasskeyEnrolled: true });
        fetchData();
      }
    } catch (e) {
      showToast('Failed to enroll staff member', 'warning');
    }
  };

  const handleAssignStaff = async (projectId, staffMember, role) => {
    if (!staffMember) {
      showToast('Please select a valid staff member', 'warning');
      return;
    }
    try {
      const res = await fetch(`/api/v1/projects/${projectId}/assign-staff`, {
        method: 'POST',
        headers: { 'Content-Type': 'application/json', 'Authorization': `Bearer ${authToken}` },
        body: JSON.stringify({
          staffId: staffMember.id,
          staffName: staffMember.name,
          staffEmail: staffMember.email,
          role: role || staffMember.role || 'Staff Engineer',
          avatar: staffMember.avatar || 'p2'
        })
      });
      const data = await res.json();
      if (res.ok && data.status === 'success') {
        showToast(`Assigned ${staffMember.name} to project!`, 'success');
        setModalType(null);
        fetchData();
      } else {
        showToast(data.message || 'Failed to assign staff', 'warning');
      }
    } catch (e) {
      showToast('Failed to assign staff to project', 'warning');
    }
  };

  const handleUnassignStaff = async (projectId, staffIdOrEmail) => {
    try {
      const res = await fetch(`/api/v1/projects/${projectId}/assign-staff/${staffIdOrEmail}`, {
        method: 'DELETE',
        headers: { 'Authorization': `Bearer ${authToken}` }
      });
      const data = await res.json();
      if (res.ok && data.status === 'success') {
        showToast('Staff member unassigned from project', 'info');
        fetchData();
      } else {
        showToast(data.message || 'Failed to remove assignment', 'warning');
      }
    } catch (e) {
      showToast('Error unassigning staff member', 'warning');
    }
  };

  const handleToggleStaffPasskey = async (staffId, currentStatus, staffMember) => {
    try {
      chimeEngine.playPop();
      const newStatus = !currentStatus;
      
      // Immediate optimistic update
      setStaff(prev => prev.map(s => 
        (String(s.id) === String(staffId) || (staffMember?.email && s.email === staffMember.email))
          ? { ...s, isPasskeyEnrolled: newStatus } 
          : s
      ));

      const res = await fetch(`/api/v1/staff/${staffId}/passkey`, {
        method: 'PATCH',
        headers: { 'Content-Type': 'application/json', 'Authorization': `Bearer ${authToken}` },
        body: JSON.stringify({ isPasskeyEnrolled: newStatus })
      });
      const data = await res.json();
      if (res.ok) {
        showToast(newStatus ? `Passkey credentials enrolled for ${data.staff?.name || staffMember?.name || 'staff'}` : `Passkey enrolment revoked for ${data.staff?.name || staffMember?.name || 'staff'}`, newStatus ? 'success' : 'info');
        fetchData();
      } else {
        showToast(data.message || 'Failed to update passkey status', 'warning');
        fetchData();
      }
    } catch (e) {
      showToast('Error updating staff passkey enrollment', 'warning');
      fetchData();
    }
  };

  const handleSaveProfile = (e) => {
    e.preventDefault();
    const updated = {
      ...currentUser,
      displayName: profileForm.displayName,
      email: profileForm.email,
      title: profileForm.occupation,
      avatarId: selectedAvatarId,
      company: profileForm.company
    };
    setCurrentUser(updated);
    localStorage.setItem('sneksoft_user', JSON.stringify(updated));
    showToast('Profile credentials saved!', 'success');
  };

  const handlePdfUpload = (e) => {
    const file = e.target?.files?.[0] || e.dataTransfer?.files?.[0];
    if (file) {
      if (file.type !== 'application/pdf' && !file.name.toLowerCase().endsWith('.pdf')) {
        showToast('Please upload a valid PDF contract file (*.pdf)', 'warning');
        return;
      }
      const sizeInMb = (file.size / (1024 * 1024)).toFixed(1) + ' MB';
      const fileUrl = URL.createObjectURL(file);

      const reader = new FileReader();
      reader.onload = (loadEvent) => {
        const base64Data = loadEvent.target?.result;
        setContractPdfFile({
          name: file.name,
          size: sizeInMb,
          url: fileUrl,
          base64: base64Data,
          uploadedAt: new Date().toLocaleTimeString()
        });
        setClientForm(prev => ({
          ...prev,
          contractPdfName: file.name,
          contractPdfSize: sizeInMb,
          contractPdfUrl: fileUrl,
          pdfBase64: base64Data
        }));
        chimeEngine.playSuccess();
        showToast(`Contract PDF '${file.name}' attached and staged for Firebase Storage!`, 'success');
      };
      reader.readAsDataURL(file);
    }
  };

  const handleDownloadContractPdf = (client) => {
    if (!client) return;
    const fileName = client.contractPdfName || `${(client.company || 'Enterprise_Client').replace(/\s+/g, '_')}_MSA_Agreement.pdf`;

    // If there is a direct Firebase Storage URL, attempt to trigger direct download or fallback to generated blob
    if (client.contractPdfUrl && (client.contractPdfUrl.startsWith('http://') || client.contractPdfUrl.startsWith('https://'))) {
      const a = document.createElement('a');
      a.href = client.contractPdfUrl;
      a.target = '_blank';
      a.download = fileName;
      document.body.appendChild(a);
      a.click();
      document.body.removeChild(a);
      chimeEngine.playSuccess();
      showToast(`Downloading contract from Firebase Storage: ${fileName}`, 'success');
      return;
    }

    const dummyPdf = `%PDF-1.4
%SNEKSOFT ENTERPRISE MASTER SERVICES AGREEMENT & SLA
======================================================
Organization:       ${client.company}
Principal Contact:  ${client.primaryContact}
Email:              ${client.email}
Account Tier:       ${client.tier || 'ENTERPRISE'}
Monthly Retainer:   ${client.monthlyRetainer || '$18,500/mo'}
Contract Term:      ${client.contractStart || '2026-01-01'} to ${client.contractEnd || '2027-12-31'}
SLA Commitment:     ${client.slaTier || '24/7 Dedicated Architecture Team (1hr SLA)'}
NDA Status:         MUTUALLY EXECUTED
Document ID:        SNEK-MSA-${Date.now().toString(36).toUpperCase()}
Storage Bucket:     ${client.contractStorageBucket || 'sneksoft-core-app.appspot.com'}
SHA-256 Checksum:   e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
======================================================
Signed on behalf of Sneksoft Technologies: Alex Chen (Staff Lead)
Signed on behalf of ${client.company}: ${client.primaryContact}
%%EOF`;
    const blob = new Blob([dummyPdf], { type: 'application/pdf' });
    const url = URL.createObjectURL(blob);
    const a = document.createElement('a');
    a.href = url;
    a.download = fileName;
    document.body.appendChild(a);
    a.click();
    document.body.removeChild(a);
    URL.revokeObjectURL(url);
    chimeEngine.playSuccess();
    showToast(`Downloading contract PDF: ${fileName}`, 'success');
  };

  const handleCreateClient = async (e) => {
    if (e && e.preventDefault) e.preventDefault();
    if (!clientForm.company.trim()) {
      showToast('Please enter a company name', 'warning');
      setClientCreationStep(1);
      return;
    }
    try {
      showToast('Persisting client to Firestore & uploading contract to Firebase Storage...', 'info');
      const payload = {
        ...clientForm,
        contractPdfName: clientForm.contractPdfName || `${clientForm.company.replace(/\s+/g, '_')}_Master_Services_Agreement_2026.pdf`,
        contractPdfSize: clientForm.contractPdfSize || '2.4 MB',
        pdfBase64: clientForm.pdfBase64 || contractPdfFile?.base64 || null,
        slaTier: clientForm.slaTier || '24/7 Dedicated Architecture Team (1hr SLA)',
        ndaSigned: true
      };

      const res = await fetch('/api/v1/clients', {
        method: 'POST',
        headers: { 'Content-Type': 'application/json', 'Authorization': `Bearer ${authToken}` },
        body: JSON.stringify(payload)
      });
      const data = await res.json();
      if (res.ok) {
        showToast(`Client '${clientForm.company}' and signed contract persisted to Firestore & Firebase Storage!`, 'success');
        chimeEngine.playSuccess();
        setModalType(null);
        setClientCreationStep(1);
        setContractPdfFile(null);
        setClientForm({
          company: '',
          primaryContact: '',
          email: '',
          phone: '',
          industry: 'Enterprise Software & Cloud',
          tier: 'ENTERPRISE',
          status: 'ACTIVE',
          billingStatus: 'CURRENT',
          monthlyRetainer: '$18,500/mo',
          contractStart: new Date().toISOString().split('T')[0],
          contractEnd: '2026-12-31',
          contractPdfName: 'Enterprise_Master_Services_Agreement_2026.pdf',
          contractPdfSize: '2.4 MB',
          contractPdfUrl: '',
          pdfBase64: null,
          contractType: 'Master Services Agreement (MSA)',
          slaTier: '24/7 Dedicated Architecture Team (1hr SLA)',
          ndaSigned: true,
          notes: '',
          assignedProjects: []
        });
        fetchData();
      } else {
        showToast(data.message || 'Failed to create client', 'warning');
      }
    } catch (err) {
      showToast('Error creating client account', 'warning');
    }
  };

  const handleUpdateClient = async (e) => {
    e.preventDefault();
    if (!editingClient) return;
    try {
      const res = await fetch(`/api/v1/clients/${editingClient.id}`, {
        method: 'PATCH',
        headers: { 'Content-Type': 'application/json', 'Authorization': `Bearer ${authToken}` },
        body: JSON.stringify(editingClient)
      });
      const data = await res.json();
      if (res.ok) {
        showToast(`Client account '${editingClient.company}' updated!`, 'success');
        setModalType(null);
        setEditingClient(null);
        fetchData();
      } else {
        showToast(data.message || 'Failed to update client', 'warning');
      }
    } catch (err) {
      showToast('Error updating client', 'warning');
    }
  };

  const handleDeleteClient = async (id, companyName) => {
    if (!confirm(`Are you sure you want to delete CRM client account '${companyName}'?`)) return;
    try {
      const res = await fetch(`/api/v1/clients/${id}`, {
        method: 'DELETE',
        headers: { 'Authorization': `Bearer ${authToken}` }
      });
      if (res.ok) {
        showToast(`Deleted CRM client account '${companyName}'`, 'info');
        fetchData();
      } else {
        showToast('Failed to delete client', 'warning');
      }
    } catch (err) {
      showToast('Error deleting client', 'warning');
    }
  };

  const handleAssignClientProject = async (clientId, projectId) => {
    try {
      const targetClient = clients.find(c => String(c.id) === String(clientId));
      if (!targetClient) return;
      const currentProjects = targetClient.assignedProjects || [];
      const updatedProjects = currentProjects.includes(String(projectId))
        ? currentProjects.filter(id => id !== String(projectId))
        : [...currentProjects, String(projectId)];

      const res = await fetch(`/api/v1/clients/${clientId}`, {
        method: 'PATCH',
        headers: { 'Content-Type': 'application/json', 'Authorization': `Bearer ${authToken}` },
        body: JSON.stringify({ assignedProjects: updatedProjects })
      });
      if (res.ok) {
        showToast(`Updated project assignments for ${targetClient.company}`, 'success');
        fetchData();
      }
    } catch (e) {
      showToast('Failed to assign project', 'warning');
    }
  };

  // If user is unauthenticated, render the dedicated Login Screen
  if (!currentUser) {
    return <LoginScreen onLoginSuccess={handleLoginSuccess} showToast={showToast} />;
  }

  const activeAvatar = AVATAR_PRESETS.find(p => p.id === selectedAvatarId) || AVATAR_PRESETS[0];

  return (
    <div className="app-layout preset-scenic-default">
      {/* Toast Notification */}
      {toast && (
        <div className="toast-container">
          <div className="toast">
            <span className="icon" style={{ color: toast.type === 'success' ? '#10B981' : toast.type === 'warning' ? '#EF4444' : '#38BDF8' }}>
              {toast.type === 'success' ? 'check_circle' : toast.type === 'warning' ? 'warning' : 'info'}
            </span>
            <span>{toast.message}</span>
          </div>
        </div>
      )}

      {/* Desktop Sidebar Navigation (Seamless on Desktop viewports) */}
      {/* Desktop Sidebar Navigation (Collapsible) */}
      <aside className={`app-sidebar ${isSidebarCollapsed ? 'collapsed' : ''}`}>
        {/* Brand Header */}
        <div
          className="sidebar-header"
          onClick={() => {
            if (isSidebarCollapsed) {
              setIsSidebarCollapsed(false);
            } else {
              navigateTo('dashboard');
            }
            chimeEngine.playPop();
          }}
          style={{ cursor: 'pointer' }}
          title={isSidebarCollapsed ? "Click to expand sidebar" : "Dashboard"}
        >
          <img
            src="/images/favicon.svg"
            alt="SN3KB1TE"
            style={{ width: '38px', height: '38px', borderRadius: '10px', filter: 'drop-shadow(0 0 10px rgba(16, 185, 129, 0.45))', flexShrink: 0 }}
            onClick={(e) => {
              if (isSidebarCollapsed) {
                e.stopPropagation();
                setIsSidebarCollapsed(false);
                chimeEngine.playPop();
              }
            }}
          />
          <div className="brand-info">
            <h1 style={{ fontSize: '16px', fontWeight: '800', margin: 0, letterSpacing: '-0.02em', color: 'var(--text-main)' }}>SN3KB1TE</h1>
            <p style={{ fontSize: '11px', color: 'var(--text-muted)', margin: 0 }}>Enterprise Platform</p>
          </div>
          <button
            className="sidebar-collapse-btn"
            onClick={(e) => {
              e.stopPropagation();
              setIsSidebarCollapsed(!isSidebarCollapsed);
              chimeEngine.playPop();
            }}
            title={isSidebarCollapsed ? "Expand Sidebar" : "Collapse Sidebar"}
            aria-label="Toggle Sidebar"
          >
            <span className="icon">{isSidebarCollapsed ? 'chevron_right' : 'chevron_left'}</span>
          </button>
        </div>

        {/* Primary Navigation */}
        <nav className="sidebar-nav">
          <div className="nav-section-title">Core Workspaces</div>

          <button
            className={`nav-item ${activeTab === 'dashboard' ? 'active' : ''}`}
            onClick={() => { navigateTo('dashboard'); chimeEngine.playPop(); }}
            data-tooltip="Overview Dashboard"
          >
            <div className="nav-item-left">
              <span className="icon">dashboard</span>
              <span>Overview</span>
            </div>
          </button>

          <button
            className={`nav-item ${activeTab === 'projects' ? 'active' : ''}`}
            onClick={() => { navigateTo('projects'); chimeEngine.playPop(); }}
            data-tooltip="Projects Hub"
          >
            <div className="nav-item-left">
              <span className="icon">folder_special</span>
              <span>Projects Hub</span>
            </div>
            {projects.length > 0 && <span className="nav-badge" style={{ background: '#0284C7' }}>{projects.length}</span>}
          </button>

          <button
            className={`nav-item ${activeTab === 'deliverables' ? 'active' : ''}`}
            onClick={() => { navigateTo('deliverables'); chimeEngine.playPop(); }}
            data-tooltip="Deliverables & Builds"
          >
            <div className="nav-item-left">
              <span className="icon">inventory_2</span>
              <span>Deliverables</span>
            </div>
            {pendingApprovalsCount > 0 && <span className="nav-badge badge-urgent">{pendingApprovalsCount}</span>}
          </button>

          <button
            className={`nav-item ${activeTab === 'tasks' ? 'active' : ''}`}
            onClick={() => { navigateTo('tasks'); chimeEngine.playPop(); }}
            data-tooltip="Tasks & Actions"
          >
            <div className="nav-item-left">
              <span className="icon">assignment</span>
              <span>Tasks & Actions</span>
            </div>
            {pendingTasksCount > 0 && <span className="nav-badge">{pendingTasksCount}</span>}
          </button>

          <button
            className={`nav-item ${activeTab === 'clients' ? 'active' : ''}`}
            onClick={() => { navigateTo('clients'); chimeEngine.playPop(); }}
            data-tooltip="CRM & Contracts"
          >
            <div className="nav-item-left">
              <span className="icon">business</span>
              <span>CRM & Contracts</span>
            </div>
            {clients.length > 0 && <span className="nav-badge" style={{ background: '#10B981' }}>{clients.length}</span>}
          </button>

          <button
            className={`nav-item ${activeTab === 'staff' ? 'active' : ''}`}
            onClick={() => { navigateTo('staff'); chimeEngine.playPop(); }}
            data-tooltip="Staff Directory"
          >
            <div className="nav-item-left">
              <span className="icon">badge</span>
              <span>Staff Directory</span>
            </div>
            {staff.length > 0 && <span className="nav-badge" style={{ background: '#8B5CF6' }}>{staff.length}</span>}
          </button>

          <button
            className={`nav-item ${activeTab === 'messages' ? 'active' : ''}`}
            onClick={() => { navigateTo('messages'); chimeEngine.playPop(); }}
            data-tooltip="Discussions"
          >
            <div className="nav-item-left">
              <span className="icon">forum</span>
              <span>Discussions</span>
            </div>
            {messages.length > 0 && <span className="nav-badge" style={{ background: '#0284C7' }}>{messages.length}</span>}
          </button>

          <div className="nav-section-title" style={{ marginTop: '10px' }}>Executive Suite</div>

          <button
            className={`nav-item ${activeTab === 'analytics' ? 'active' : ''}`}
            onClick={() => { navigateTo('analytics'); chimeEngine.playPop(); }}
            data-tooltip="Analytics & Audits"
          >
            <div className="nav-item-left">
              <span className="icon">analytics</span>
              <span>Analytics & Audits</span>
            </div>
          </button>

          <button
            className={`nav-item ${activeTab === 'webhooks' ? 'active' : ''}`}
            onClick={() => { navigateTo('webhooks'); chimeEngine.playPop(); }}
            data-tooltip="Webhooks & CI/CD"
          >
            <div className="nav-item-left">
              <span className="icon">webhook</span>
              <span>Webhooks & CI/CD</span>
            </div>
          </button>

          <button
            className={`nav-item ${activeTab === 'health' ? 'active' : ''}`}
            onClick={() => { navigateTo('health'); chimeEngine.playPop(); }}
            data-tooltip="System Health"
          >
            <div className="nav-item-left">
              <span className="icon">monitor_heart</span>
              <span>System Health</span>
            </div>
          </button>

          <button
            className={`nav-item ${activeTab === 'profile' ? 'active' : ''}`}
            onClick={() => { navigateTo('profile'); chimeEngine.playPop(); }}
            data-tooltip="Profile & Settings"
          >
            <div className="nav-item-left">
              <span className="icon">settings</span>
              <span>Profile & Settings</span>
            </div>
          </button>
        </nav>

        {/* Sidebar Footer User Card */}
        <div className="sidebar-footer">
          <div className="staff-user-card" onClick={() => { navigateTo('profile'); chimeEngine.playPop(); }} style={{ cursor: 'pointer' }}>
            <div className="staff-avatar" style={{ background: activeAvatar.bg }}>
              {customAvatarUrl ? (
                <img src={customAvatarUrl} alt="Avatar" style={{ width: '100%', height: '100%', borderRadius: '10px', objectFit: 'cover' }} />
              ) : (
                <span className="icon" style={{ fontSize: '18px', color: '#FFFFFF' }}>{activeAvatar.icon}</span>
              )}
            </div>
            <div className="staff-info">
              <div className="staff-name">{currentUser.displayName}</div>
              <div className="staff-role">{currentUser.role === 'STAFF' ? 'Staff Engineer' : 'Client Partner'}</div>
            </div>
          </div>
        </div>
      </aside>

      {/* Main Content Area */}
      <main className="app-main">
        {/* Topbar Header */}
        <header className="app-topbar">
          <div className="topbar-left" style={{ display: 'flex', alignItems: 'center', gap: '12px' }}>
            {/* Project Filter Selector */}
            <select className="project-selector" style={{ minWidth: '180px' }} value={selectedProjectId} onChange={(e) => setSelectedProjectId(e.target.value)}>
              <option value="ALL">All Projects ({projects.length})</option>
              {projects.map(p => <option key={p.id} value={p.id}>{p.title}</option>)}
            </select>

            {/* Search Input */}
            <div className="search-container" style={{ minWidth: '240px', maxWidth: '340px' }}>
              <span className="icon search-icon">search</span>
              <input
                type="text"
                className="search-input"
                placeholder="Search portal, builds, tasks..."
                value={searchQuery}
                onChange={(e) => setSearchQuery(e.target.value)}
              />
            </div>
          </div>

          <div className="topbar-right" style={{ display: 'flex', alignItems: 'center', gap: '10px' }}>
            {/* Quick Action: New Project */}
            <button className="btn-primary" style={{ padding: '7px 14px', fontSize: '12px' }} onClick={() => { setModalType('CREATE_PROJECT'); chimeEngine.playPop(); }}>
              <span className="icon" style={{ fontSize: '16px' }}>add</span><span>New Project</span>
            </button>

            {/* Quick Action: New Client */}
            <button className="btn-secondary" style={{ padding: '7px 14px', fontSize: '12px' }} onClick={() => { setClientCreationStep(1); setModalType('CREATE_CLIENT'); chimeEngine.playPop(); }}>
              <span className="icon" style={{ fontSize: '16px', color: '#10B981' }}>person_add</span><span>New Client</span>
            </button>
          </div>
        </header>

        {/* Viewport Content */}
        <div className="content-viewport">
          {/* 1. DASHBOARD */}
          {activeTab === 'dashboard' && (
            <div>
              <div className="bento-hero">
                <div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'flex-start', flexWrap: 'wrap', gap: '16px' }}>
                  <div>
                    <div style={{ display: 'inline-flex', alignItems: 'center', gap: '6px', padding: '4px 10px', borderRadius: '9999px', background: 'rgba(16, 185, 129, 0.2)', color: '#10B981', fontSize: '11px', fontWeight: '700', letterSpacing: '0.05em', marginBottom: '8px' }}>
                      <span className="icon" style={{ fontSize: '14px' }}>verified</span>
                      SNEKSOFT ENTERPRISE CLIENT ENVIRONMENT
                    </div>
                    <h2 style={{ fontSize: '26px', fontWeight: '800', letterSpacing: '-0.02em' }}>Client Portfolio & Deliverables Gateway</h2>
                    <p style={{ color: 'var(--text-muted)', fontSize: '13px', marginTop: '4px', maxWidth: '640px' }}>
                      Access certified staging APKs, inspect architectural milestones, review deliverables, and communicate securely with the lead engineering team.
                    </p>
                  </div>
                  <div style={{ display: 'flex', gap: '10px' }}>
                    <button className="btn-secondary" onClick={() => setModalType('CREATE_DELIVERABLE')}><span className="icon">upload_file</span><span>Publish Build</span></button>
                    <button className="btn-secondary" onClick={() => setModalType('CREATE_TASK')}><span className="icon">add_task</span><span>Assign Task</span></button>
                  </div>
                </div>

                <div className="hero-stats-grid">
                  <div className="hero-stat-card">
                    <div className="stat-icon-wrapper stat-icon-blue"><span className="icon">folder_special</span></div>
                    <div><div className="stat-label">Total Projects</div><div className="stat-value">{projects.length}</div></div>
                  </div>
                  <div className="hero-stat-card">
                    <div className="stat-icon-wrapper stat-icon-emerald"><span className="icon">donut_large</span></div>
                    <div><div className="stat-label">Avg Portfolio Progress</div><div className="stat-value">{avgCompletion}%</div></div>
                  </div>
                  <div className="hero-stat-card">
                    <div className="stat-icon-wrapper stat-icon-amber"><span className="icon">pending_actions</span></div>
                    <div><div className="stat-label">Pending Sign-Offs</div><div className="stat-value">{pendingApprovalsCount}</div></div>
                  </div>
                  <div className="hero-stat-card">
                    <div className="stat-icon-wrapper stat-icon-rose"><span className="icon">checklist</span></div>
                    <div><div className="stat-label">Open Tasks</div><div className="stat-value">{pendingTasksCount}</div></div>
                  </div>
                </div>
              </div>

              <div className="bento-grid-2col">
                {/* Active Projects Bento */}
                <div className="bento-card">
                  <div className="bento-card-header">
                    <div className="bento-card-title"><span className="icon" style={{ color: 'var(--primary)' }}>apps</span><span>Active Client Projects</span></div>
                    <button className="btn-secondary" style={{ padding: '4px 10px', fontSize: '12px' }} onClick={() => navigateTo('projects')}>View All ({projects.length})</button>
                  </div>
                  <div style={{ display: 'grid', gridTemplateColumns: 'repeat(auto-fit, minmax(280px, 1fr))', gap: '16px' }}>
                    {filteredProjects.slice(0, 4).map(p => (
                      <div
                        key={p.id}
                        className="bento-card"
                        style={{ padding: '16px', background: 'var(--bg-card-secondary)', cursor: 'pointer' }}
                        onClick={() => { setActiveProjectDetail(p); navigateTo('projects', p.id); chimeEngine.playPop(); }}
                      >
                        <div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', marginBottom: '8px' }}>
                          <span style={{ fontSize: '11px', fontWeight: '700', color: p.accentColorHex || '#10B981', textTransform: 'uppercase' }}>{p.category}</span>
                          <span style={{ fontSize: '12px', fontWeight: '700', color: 'var(--text-main)' }}>{p.progress}%</span>
                        </div>
                        <h4 style={{ fontSize: '15px', fontWeight: '700', marginBottom: '4px' }}>{p.title}</h4>
                        <p style={{ fontSize: '12px', color: 'var(--text-muted)', marginBottom: '12px' }}>Client: {p.clientName}</p>
                        <div className="progress-bar-container">
                          <div className="progress-bar-fill" style={{ width: `${p.progress}%`, background: p.accentColorHex || '#10B981' }}></div>
                        </div>
                      </div>
                    ))}
                  </div>
                </div>

                {/* Pending Approvals Bento */}
                <div className="bento-card">
                  <div className="bento-card-header">
                    <div className="bento-card-title"><span className="icon" style={{ color: 'var(--amber)' }}>gavel</span><span>Pending Deliverable Approvals</span></div>
                    <button className="btn-secondary" style={{ padding: '4px 10px', fontSize: '12px' }} onClick={() => { navigateTo('deliverables'); setDeliverableFilter('PENDING'); }}>
                      Pending ({pendingApprovalsCount})
                    </button>
                  </div>
                  {deliverables.filter(d => d.status === 'PENDING_APPROVAL').length === 0 ? (
                    <div style={{ textAlign: 'center', padding: '36px', color: 'var(--text-muted)' }}>
                      <span className="icon" style={{ fontSize: '42px', color: '#10B981', marginBottom: '8px' }}>task_alt</span>
                      <p style={{ fontWeight: '600' }}>All deliverables certified & up to date!</p>
                    </div>
                  ) : (
                    <div style={{ display: 'flex', flexDirection: 'column', gap: '10px' }}>
                      {deliverables.filter(d => d.status === 'PENDING_APPROVAL').slice(0, 4).map(d => (
                        <div key={d.id} className="deliverable-item">
                          <div className="badge-file-type">{d.fileType}</div>
                          <div className="deliverable-info">
                            <div className="deliverable-title">{d.title}</div>
                            <div className="deliverable-meta">v{d.buildNumber || '1.0'} • Submitted by {d.submittedBy || 'Engineering'}</div>
                          </div>
                          <div className="deliverable-actions">
                            <button className="btn-success" style={{ padding: '6px 12px', fontSize: '12px' }} onClick={() => { setTargetDeliverable(d); setModalType('APPROVE_DELIV'); }}>Approve</button>
                            <button className="btn-danger" style={{ padding: '6px 12px', fontSize: '12px' }} onClick={() => { setTargetDeliverable(d); setModalType('CHANGES_DELIV'); }}>Changes</button>
                          </div>
                        </div>
                      ))}
                    </div>
                  )}
                </div>
              </div>
            </div>
          )}

          {/* 2. PROJECTS HUB */}
          {activeTab === 'projects' && (
            <div>
              {/* Projects Hero Banner */}
              <div className="bento-hero">
                <div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'flex-start', flexWrap: 'wrap', gap: '16px' }}>
                  <div>
                    <div style={{ display: 'inline-flex', alignItems: 'center', gap: '6px', padding: '4px 10px', borderRadius: '9999px', background: 'rgba(2, 132, 199, 0.2)', color: 'var(--primary)', fontSize: '11px', fontWeight: '700', letterSpacing: '0.05em', marginBottom: '8px' }}>
                      <span className="icon" style={{ fontSize: '14px' }}>folder_special</span>
                      ENGINEERING PORTFOLIO & WORKSPACES
                    </div>
                    <h2 style={{ fontSize: '26px', fontWeight: '800', letterSpacing: '-0.02em' }}>Enterprise Client Projects & Architecture</h2>
                    <p style={{ color: 'var(--text-muted)', fontSize: '13px', marginTop: '4px', maxWidth: '640px' }}>
                      Monitor project milestones, inspect technical roadmap progress, review deliverables, collaborate with assigned engineering leads, and manage sprint deliverables.
                    </p>
                  </div>
                  <div style={{ display: 'flex', gap: '10px' }}>
                    <button className="btn-primary" onClick={() => { setModalType('CREATE_PROJECT'); chimeEngine.playPop(); }}>
                      <span className="icon">add</span><span>New Project</span>
                    </button>
                    <button className="btn-secondary" onClick={() => { setModalType('CREATE_DELIVERABLE'); chimeEngine.playPop(); }}>
                      <span className="icon">upload_file</span><span>Publish Build</span>
                    </button>
                  </div>
                </div>

                <div className="hero-stats-grid">
                  <div className="hero-stat-card">
                    <div className="stat-icon-wrapper stat-icon-blue"><span className="icon">folder</span></div>
                    <div><div className="stat-label">Active Projects</div><div className="stat-value">{projects.length}</div></div>
                  </div>
                  <div className="hero-stat-card">
                    <div className="stat-icon-wrapper stat-icon-emerald"><span className="icon">donut_large</span></div>
                    <div><div className="stat-label">Avg Portfolio Progress</div><div className="stat-value">{avgCompletion}%</div></div>
                  </div>
                  <div className="hero-stat-card">
                    <div className="stat-icon-wrapper stat-icon-amber"><span className="icon">verified</span></div>
                    <div><div className="stat-label">Approved Builds</div><div className="stat-value">{deliverables.filter(d => d.status === 'APPROVED').length}</div></div>
                  </div>
                  <div className="hero-stat-card">
                    <div className="stat-icon-wrapper stat-icon-rose"><span className="icon">assignment_late</span></div>
                    <div><div className="stat-label">Pending Tasks</div><div className="stat-value">{pendingTasksCount}</div></div>
                  </div>
                </div>
              </div>

              {/* Project Filter & Desktop View Mode Switcher */}
              <div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', flexWrap: 'wrap', gap: '14px', marginBottom: '20px', padding: '14px 18px', background: 'var(--bg-card)', borderRadius: '16px', border: '1px solid var(--border-subtle)' }}>
                <div style={{ display: 'flex', gap: '8px', flexWrap: 'wrap', alignItems: 'center' }}>
                  <span style={{ fontSize: '12px', fontWeight: '700', color: 'var(--text-muted)', marginRight: '6px' }}>Category:</span>
                  <button
                    className={`btn-secondary ${projectCategoryFilter === 'ALL' ? 'active' : ''}`}
                    style={{ padding: '6px 12px', fontSize: '12px', borderRadius: '8px', background: projectCategoryFilter === 'ALL' ? 'var(--primary)' : 'rgba(255,255,255,0.05)', color: projectCategoryFilter === 'ALL' ? '#FFFFFF' : 'var(--text-main)' }}
                    onClick={() => setProjectCategoryFilter('ALL')}
                  >
                    All Workspaces ({projects.length})
                  </button>
                  {Array.from(new Set(projects.map(p => p.category).filter(Boolean))).map(cat => (
                    <button
                      key={cat}
                      className={`btn-secondary ${projectCategoryFilter === cat ? 'active' : ''}`}
                      style={{ padding: '6px 12px', fontSize: '12px', borderRadius: '8px', background: projectCategoryFilter === cat ? 'var(--primary)' : 'rgba(255,255,255,0.05)', color: projectCategoryFilter === cat ? '#FFFFFF' : 'var(--text-main)' }}
                      onClick={() => setProjectCategoryFilter(cat)}
                    >
                      {cat}
                    </button>
                  ))}
                </div>

                {/* Desktop View Switcher */}
                <div style={{ display: 'flex', gap: '6px', alignItems: 'center', background: 'var(--bg-card-secondary)', padding: '4px', borderRadius: '10px', border: '1px solid var(--border-subtle)' }}>
                  <button
                    className="btn-icon"
                    style={{ width: '36px', height: '36px', borderRadius: '8px', background: projectViewMode === 'kanban' ? 'var(--primary)' : 'transparent', color: projectViewMode === 'kanban' ? '#FFFFFF' : 'var(--text-muted)' }}
                    onClick={() => setProjectViewMode('kanban')}
                    title="Kanban Board View"
                  >
                    <span className="icon" style={{ fontSize: '18px' }}>view_kanban</span>
                  </button>
                  <button
                    className="btn-icon"
                    style={{ width: '36px', height: '36px', borderRadius: '8px', background: projectViewMode === 'grid' ? 'var(--primary)' : 'transparent', color: projectViewMode === 'grid' ? '#FFFFFF' : 'var(--text-muted)' }}
                    onClick={() => setProjectViewMode('grid')}
                    title="Grid Cards View"
                  >
                    <span className="icon" style={{ fontSize: '18px' }}>grid_view</span>
                  </button>
                  <button
                    className="btn-icon"
                    style={{ width: '36px', height: '36px', borderRadius: '8px', background: projectViewMode === 'matrix' ? 'var(--primary)' : 'transparent', color: projectViewMode === 'matrix' ? '#FFFFFF' : 'var(--text-muted)' }}
                    onClick={() => setProjectViewMode('matrix')}
                    title="Table Matrix View"
                  >
                    <span className="icon" style={{ fontSize: '18px' }}>table_chart</span>
                  </button>
                  <button
                    className="btn-icon"
                    style={{ width: '36px', height: '36px', borderRadius: '8px', background: projectViewMode === 'split' ? 'var(--primary)' : 'transparent', color: projectViewMode === 'split' ? '#FFFFFF' : 'var(--text-muted)' }}
                    onClick={() => setProjectViewMode('split')}
                    title="Master-Detail Split View"
                  >
                    <span className="icon" style={{ fontSize: '18px' }}>view_sidebar</span>
                  </button>
                </div>
              </div>

              {/* Split Master-Detail View Mode */}
              {projectViewMode === 'split' && (
                <div className="split-pane">
                  {/* Left List of Projects */}
                  <div className="pane-list">
                    <div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', padding: '0 4px', marginBottom: '4px' }}>
                      <span style={{ fontSize: '13px', fontWeight: '700', color: 'var(--text-muted)' }}>Projects ({filteredProjects.length})</span>
                      <button className="btn-secondary" style={{ padding: '3px 8px', fontSize: '11px' }} onClick={() => setModalType('CREATE_PROJECT')}>+ Add Project</button>
                    </div>

                    {filteredProjects.length === 0 ? (
                      <div className="bento-card" style={{ textAlign: 'center', padding: '36px 16px' }}>
                        <span className="icon" style={{ fontSize: '32px', color: 'var(--text-muted)', marginBottom: '8px' }}>folder_off</span>
                        <p style={{ fontSize: '13px', color: 'var(--text-muted)' }}>No projects match your filter</p>
                      </div>
                    ) : (
                      filteredProjects.map(p => {
                        const isSelected = activeProjectDetail?.id === p.id;
                        const projDeliverables = deliverables.filter(d => String(d.projectId) === String(p.id));
                        const projTasks = tasks.filter(t => String(t.projectId) === String(p.id));

                        return (
                          <div
                            key={p.id}
                            className={`project-item-card ${isSelected ? 'selected' : ''}`}
                            onClick={() => { setActiveProjectDetail(p); navigateTo('projects', p.id); chimeEngine.playPop(); }}
                          >
                            <div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}>
                              <span style={{ fontSize: '10px', fontWeight: '800', color: p.accentColorHex || '#10B981', textTransform: 'uppercase', letterSpacing: '0.04em', background: 'rgba(255,255,255,0.05)', padding: '2px 8px', borderRadius: '4px' }}>
                                {p.category || 'Mobile App'}
                              </span>
                              <span style={{ fontSize: '11px', color: 'var(--text-muted)', display: 'flex', alignItems: 'center', gap: '4px' }}>
                                <span className="icon" style={{ fontSize: '13px' }}>calendar_today</span>
                                {p.deadline || 'Q4 2026'}
                              </span>
                            </div>

                            <div>
                              <div style={{ fontSize: '15px', fontWeight: '800', color: 'var(--text-main)', marginBottom: '2px' }}>{p.title}</div>
                              <div style={{ fontSize: '12px', color: 'var(--text-muted)' }}>Client: <strong style={{ color: 'var(--text-main)' }}>{p.clientName}</strong></div>
                            </div>

                            <div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', fontSize: '11px', color: 'var(--text-muted)', marginTop: '2px' }}>
                              <span>Progress</span>
                              <span style={{ fontWeight: '800', color: 'var(--text-main)' }}>{p.progress || 0}%</span>
                            </div>

                            <div className="progress-bar-container" style={{ height: '6px' }}>
                              <div className="progress-bar-fill" style={{ width: `${p.progress || 0}%`, background: p.accentColorHex || '#10B981' }}></div>
                            </div>

                            <div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', paddingTop: '4px', borderTop: '1px solid var(--border-subtle)', fontSize: '11px', color: 'var(--text-muted)' }}>
                              <span style={{ display: 'inline-flex', alignItems: 'center', gap: '4px' }}>
                                <span className="icon" style={{ fontSize: '13px', color: '#0284C7' }}>inventory_2</span>
                                {projDeliverables.length} Builds
                              </span>
                              <span style={{ display: 'inline-flex', alignItems: 'center', gap: '4px' }}>
                                <span className="icon" style={{ fontSize: '13px', color: '#EF4444' }}>checklist</span>
                                {projTasks.filter(t => !t.isCompleted).length} Tasks
                              </span>
                              <span style={{ display: 'inline-flex', alignItems: 'center', gap: '4px' }}>
                                <span className="icon" style={{ fontSize: '13px', color: '#10B981' }}>groups</span>
                                {p.assignedStaff?.length || 0} Staff
                              </span>
                            </div>
                          </div>
                        );
                      })
                    )}
                  </div>

                  {/* Right Detail Pane */}
                  <div className="pane-detail">
                    {activeProjectDetail ? (
                      <>
                        {/* Project Header Banner */}
                        <div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'flex-start', flexWrap: 'wrap', gap: '16px', borderBottom: '1px solid var(--border-subtle)', paddingBottom: '18px' }}>
                          <div style={{ flex: 1, minWidth: '240px' }}>
                            <div style={{ display: 'inline-flex', alignItems: 'center', gap: '6px', padding: '3px 10px', borderRadius: '6px', background: 'rgba(16, 185, 129, 0.15)', color: activeProjectDetail.accentColorHex || '#10B981', fontSize: '11px', fontWeight: '800', textTransform: 'uppercase', marginBottom: '8px' }}>
                              <span className="icon" style={{ fontSize: '14px' }}>verified</span>
                              {activeProjectDetail.category || 'Enterprise Development'}
                            </div>
                            <h2 style={{ fontSize: '24px', fontWeight: '800', letterSpacing: '-0.02em', margin: '0 0 6px 0' }}>{activeProjectDetail.title}</h2>
                            <div style={{ display: 'flex', alignItems: 'center', gap: '14px', flexWrap: 'wrap', fontSize: '12px', color: 'var(--text-muted)' }}>
                              <span>Client Partner: <strong style={{ color: 'var(--text-main)' }}>{activeProjectDetail.clientName}</strong></span>
                              <span>•</span>
                              <span>Target Deadline: <strong style={{ color: 'var(--text-main)' }}>{activeProjectDetail.deadline}</strong></span>
                              <span>•</span>
                              <span>Status: <span className="status-badge status-active">Active</span></span>
                            </div>
                          </div>

                          <div style={{ display: 'flex', gap: '8px', flexWrap: 'wrap' }}>
                            <button
                              className="btn-primary"
                              style={{ padding: '8px 14px', fontSize: '12px' }}
                              onClick={() => {
                                setDeliverableForm(prev => ({ ...prev, projectId: String(activeProjectDetail.id) }));
                                setModalType('CREATE_DELIVERABLE');
                                chimeEngine.playPop();
                              }}
                            >
                              <span className="icon" style={{ fontSize: '16px' }}>upload_file</span>
                              <span>Add Build</span>
                            </button>
                            <button
                              className="btn-secondary"
                              style={{ padding: '8px 14px', fontSize: '12px' }}
                              onClick={() => {
                                setTaskForm(prev => ({ ...prev, projectId: String(activeProjectDetail.id) }));
                                setModalType('CREATE_TASK');
                                chimeEngine.playPop();
                              }}
                            >
                              <span className="icon" style={{ fontSize: '16px' }}>add_task</span>
                              <span>Add Task</span>
                            </button>
                          </div>
                        </div>

                        {/* Progress Bar & Description */}
                        <div>
                          <div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', marginBottom: '6px' }}>
                            <span style={{ fontSize: '12px', fontWeight: '700', color: 'var(--text-muted)' }}>Overall Milestone Completion</span>
                            <span style={{ fontSize: '14px', fontWeight: '800', color: activeProjectDetail.accentColorHex || '#10B981' }}>{activeProjectDetail.progress}%</span>
                          </div>
                          <div className="progress-bar-container" style={{ height: '8px', marginBottom: '14px' }}>
                            <div className="progress-bar-fill" style={{ width: `${activeProjectDetail.progress}%`, background: activeProjectDetail.accentColorHex || '#10B981' }}></div>
                          </div>
                          {activeProjectDetail.description && (
                            <div style={{ fontSize: '13px', lineHeight: '1.6', background: 'var(--bg-card-secondary)', padding: '12px 16px', borderRadius: '12px', border: '1px solid var(--border-subtle)', color: 'var(--text-main)', display: 'flex', alignItems: 'flex-start', gap: '10px' }}>
                              <span className="icon" style={{ fontSize: '18px', color: 'var(--primary)', flexShrink: 0, marginTop: '2px' }}>description</span>
                              <div>
                                <div style={{ fontSize: '11px', fontWeight: '700', textTransform: 'uppercase', letterSpacing: '0.04em', color: 'var(--text-muted)', marginBottom: '2px' }}>Project Overview</div>
                                <div>{activeProjectDetail.description}</div>
                              </div>
                            </div>
                          )}
                        </div>

                        {/* Assigned Engineering Team Roster */}
                        <div style={{ background: 'var(--bg-card-secondary)', padding: '16px', borderRadius: '14px', border: '1px solid var(--border-subtle)' }}>
                          <div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', marginBottom: '12px' }}>
                            <div style={{ display: 'flex', alignItems: 'center', gap: '8px' }}>
                              <span className="icon" style={{ color: '#10B981', fontSize: '20px' }}>groups</span>
                              <span style={{ fontSize: '14px', fontWeight: '800' }}>Assigned Engineering Team</span>
                              <span style={{ fontSize: '11px', padding: '2px 8px', borderRadius: '9999px', background: 'rgba(16, 185, 129, 0.15)', color: '#10B981', fontWeight: '700' }}>
                                {activeProjectDetail.assignedStaff?.length || 0} Staff
                              </span>
                            </div>
                            <button
                              className="btn-primary"
                              style={{ padding: '5px 12px', fontSize: '11px' }}
                              onClick={() => {
                                setAssignStaffForm({ staffId: staff[0]?.id || '', role: 'Senior Android Engineer' });
                                setModalType('ASSIGN_STAFF');
                                chimeEngine.playPop();
                              }}
                            >
                              <span className="icon" style={{ fontSize: '15px' }}>person_add</span>
                              <span>Assign Staff</span>
                            </button>
                          </div>

                          {activeProjectDetail.assignedStaff && activeProjectDetail.assignedStaff.length > 0 ? (
                            <div style={{ display: 'flex', flexWrap: 'wrap', gap: '10px' }}>
                              {activeProjectDetail.assignedStaff.map(s => (
                                <div
                                  key={s.id || s.email}
                                  style={{
                                    display: 'inline-flex',
                                    alignItems: 'center',
                                    gap: '8px',
                                    background: 'var(--bg-card)',
                                    padding: '6px 12px',
                                    borderRadius: '9999px',
                                    border: '1px solid var(--border-subtle)',
                                    boxShadow: '0 2px 6px rgba(0,0,0,0.08)'
                                  }}
                                >
                                  <div
                                    style={{
                                      width: '24px',
                                      height: '24px',
                                      borderRadius: '50%',
                                      background: 'linear-gradient(135deg, #10B981, #059669)',
                                      color: '#fff',
                                      fontSize: '11px',
                                      fontWeight: '700',
                                      display: 'flex',
                                      alignItems: 'center',
                                      justifyContent: 'center'
                                    }}
                                  >
                                    {s.name ? s.name.charAt(0).toUpperCase() : 'S'}
                                  </div>
                                  <div style={{ display: 'flex', flexDirection: 'column' }}>
                                    <span style={{ fontSize: '12px', fontWeight: '700', lineHeight: 1.1 }}>{s.name}</span>
                                    <span style={{ fontSize: '10px', color: 'var(--text-muted)' }}>{s.role || 'Staff Lead'}</span>
                                  </div>
                                  <button
                                    onClick={() => handleUnassignStaff(activeProjectDetail.id, s.id || s.email)}
                                    title="Remove staff from project"
                                    style={{
                                      background: 'none',
                                      border: 'none',
                                      color: '#EF4444',
                                      cursor: 'pointer',
                                      padding: '2px',
                                      marginLeft: '4px',
                                      display: 'flex',
                                      alignItems: 'center'
                                    }}
                                  >
                                    <span className="icon" style={{ fontSize: '16px' }}>close</span>
                                  </button>
                                </div>
                              ))}
                            </div>
                          ) : (
                            <div style={{ fontSize: '12px', color: 'var(--text-muted)', display: 'flex', alignItems: 'center', gap: '6px', padding: '4px 0' }}>
                              <span className="icon" style={{ fontSize: '16px' }}>info</span>
                              <span>No staff assigned to this project yet. Click &quot;Assign Staff&quot; to attach lead engineers.</span>
                            </div>
                          )}
                        </div>

                        {/* Interactive Project Tabs */}
                        <div>
                          <div className="project-detail-tabs">
                            <button
                              className={`project-tab-btn ${activeProjectTab === 'milestones' ? 'active' : ''}`}
                              onClick={() => { setActiveProjectTab('milestones'); chimeEngine.playDing(); }}
                            >
                              <span className="icon" style={{ fontSize: '16px' }}>timeline</span>
                              <span>Roadmap Milestones</span>
                            </button>
                            <button
                              className={`project-tab-btn ${activeProjectTab === 'builds' ? 'active' : ''}`}
                              onClick={() => { setActiveProjectTab('builds'); chimeEngine.playDing(); }}
                            >
                              <span className="icon" style={{ fontSize: '16px' }}>inventory_2</span>
                              <span>Deliverables & Builds</span>
                              <span className="project-tab-badge">{deliverables.filter(d => String(d.projectId) === String(activeProjectDetail.id)).length}</span>
                            </button>
                            <button
                              className={`project-tab-btn ${activeProjectTab === 'tasks' ? 'active' : ''}`}
                              onClick={() => { setActiveProjectTab('tasks'); chimeEngine.playDing(); }}
                            >
                              <span className="icon" style={{ fontSize: '16px' }}>checklist</span>
                              <span>Project Tasks</span>
                              <span className="project-tab-badge">{tasks.filter(t => String(t.projectId) === String(activeProjectDetail.id)).length}</span>
                            </button>
                            <button
                              className={`project-tab-btn ${activeProjectTab === 'chat' ? 'active' : ''}`}
                              onClick={() => { setActiveProjectTab('chat'); chimeEngine.playDing(); }}
                            >
                              <span className="icon" style={{ fontSize: '16px' }}>forum</span>
                              <span>Discussion Stream</span>
                              <span className="project-tab-badge">{messages.filter(m => String(m.projectId) === String(activeProjectDetail.id)).length}</span>
                            </button>
                          </div>

                          {/* 1. Milestones Tab */}
                          {activeProjectTab === 'milestones' && (
                            <div className="milestones-card-list">
                              {[
                                { phase: 'Phase 1', title: 'Project Scoping & Architecture Requirements', date: 'Certified & Signed Off', status: 'COMPLETED', done: true, progressNeeded: 0 },
                                { phase: 'Phase 2', title: 'UI/UX Design Mockups & Design Tokens', date: 'Certified & Signed Off', status: 'COMPLETED', done: true, progressNeeded: 20 },
                                { phase: 'Phase 3', title: 'Staging APK Deployment & Passkey Verification', date: activeProjectDetail.progress >= 50 ? 'Certified' : 'In Active Progress', status: activeProjectDetail.progress >= 50 ? 'COMPLETED' : 'IN_PROGRESS', done: activeProjectDetail.progress >= 50, progressNeeded: 50 },
                                { phase: 'Phase 4', title: 'Security Penetration Testing & Telemetry Audit', date: activeProjectDetail.progress >= 80 ? 'Certified' : 'Upcoming Sprint', status: activeProjectDetail.progress >= 80 ? 'COMPLETED' : 'UPCOMING', done: activeProjectDetail.progress >= 80, progressNeeded: 80 },
                                { phase: 'Phase 5', title: 'Production Release & Google Play Store Submission', date: activeProjectDetail.progress >= 100 ? 'Certified Release' : 'Final Sign-off', status: activeProjectDetail.progress >= 100 ? 'COMPLETED' : 'UPCOMING', done: activeProjectDetail.progress >= 100, progressNeeded: 100 }
                              ].map((m, idx) => {
                                const isDone = m.done;
                                const isInProgress = !m.done && activeProjectDetail.progress >= m.progressNeeded - 30;
                                const cardClass = isDone ? 'done' : isInProgress ? 'in-progress' : 'upcoming';

                                return (
                                  <div key={idx} className={`milestone-card ${cardClass}`}>
                                    <div className={`milestone-icon-wrapper ${isDone ? 'milestone-icon-done' : isInProgress ? 'milestone-icon-progress' : 'milestone-icon-upcoming'}`}>
                                      <span className="icon" style={{ fontSize: '18px' }}>
                                        {isDone ? 'check_circle' : isInProgress ? 'pending' : 'radio_button_unchecked'}
                                      </span>
                                    </div>
                                    <div className="milestone-content">
                                      <span className="milestone-phase-badge" style={{ background: isDone ? 'rgba(16, 185, 129, 0.15)' : isInProgress ? 'rgba(56, 189, 248, 0.15)' : 'rgba(255, 255, 255, 0.05)', color: isDone ? '#10B981' : isInProgress ? '#38BDF8' : 'var(--text-muted)' }}>
                                        {m.phase}
                                      </span>
                                      <div className="milestone-title">{m.title}</div>
                                      <div className="milestone-status-chip" style={{ color: isDone ? '#10B981' : isInProgress ? '#38BDF8' : 'var(--text-muted)' }}>
                                        <span className="icon" style={{ fontSize: '13px' }}>{isDone ? 'task_alt' : isInProgress ? 'sync' : 'schedule'}</span>
                                        <span>{m.date}</span>
                                      </div>
                                    </div>
                                    <div style={{ textAlign: 'right', flexShrink: 0 }}>
                                      {isDone ? (
                                        <span className="status-badge status-approved" style={{ fontSize: '11px' }}>Complete</span>
                                      ) : isInProgress ? (
                                        <span className="status-badge status-active" style={{ fontSize: '11px' }}>In Progress</span>
                                      ) : (
                                        <span className="status-badge status-pending" style={{ fontSize: '11px' }}>Queued</span>
                                      )}
                                    </div>
                                  </div>
                                );
                              })}
                            </div>
                          )}

                          {/* 2. Builds Tab */}
                          {activeProjectTab === 'builds' && (
                            <div style={{ display: 'flex', flexDirection: 'column', gap: '10px' }}>
                              {deliverables.filter(d => String(d.projectId) === String(activeProjectDetail.id)).length === 0 ? (
                                <div style={{ textAlign: 'center', padding: '36px', color: 'var(--text-muted)', background: 'var(--bg-card-secondary)', borderRadius: '12px' }}>
                                  <span className="icon" style={{ fontSize: '32px', color: 'var(--primary)', marginBottom: '6px' }}>inventory_2</span>
                                  <p>No deliverables uploaded for this project yet.</p>
                                  <button className="btn-primary" style={{ marginTop: '10px', fontSize: '12px' }} onClick={() => setModalType('CREATE_DELIVERABLE')}>+ Publish First Build</button>
                                </div>
                              ) : (
                                deliverables.filter(d => String(d.projectId) === String(activeProjectDetail.id)).map(d => (
                                  <div key={d.id} className="deliverable-item">
                                    <div className="badge-file-type">{d.fileType}</div>
                                    <div className="deliverable-info">
                                      <div style={{ display: 'flex', alignItems: 'center', gap: '8px' }}>
                                        <div className="deliverable-title">{d.title}</div>
                                        <span className={`status-badge status-${d.status.toLowerCase().replace('_', '-')}`}>{d.status.replace('_', ' ')}</span>
                                      </div>
                                      <div className="deliverable-meta">Version {d.buildNumber || '1.0'} • Submitted by {d.submittedBy || 'Engineering'}</div>
                                    </div>
                                    <div className="deliverable-actions">
                                      <a href={d.downloadUrl} target="_blank" rel="noopener noreferrer" className="btn-secondary" style={{ padding: '6px 12px', fontSize: '12px' }}>
                                        <span className="icon">download</span><span>Download</span>
                                      </a>
                                    </div>
                                  </div>
                                ))
                              )}
                            </div>
                          )}

                          {/* 3. Tasks Tab */}
                          {activeProjectTab === 'tasks' && (
                            <div style={{ display: 'flex', flexDirection: 'column', gap: '8px' }}>
                              {tasks.filter(t => String(t.projectId) === String(activeProjectDetail.id)).length === 0 ? (
                                <div style={{ textAlign: 'center', padding: '36px', color: 'var(--text-muted)', background: 'var(--bg-card-secondary)', borderRadius: '12px' }}>
                                  <span className="icon" style={{ fontSize: '32px', color: '#10B981', marginBottom: '6px' }}>checklist</span>
                                  <p>No action items assigned for this project yet.</p>
                                  <button className="btn-primary" style={{ marginTop: '10px', fontSize: '12px' }} onClick={() => setModalType('CREATE_TASK')}>+ Assign Task</button>
                                </div>
                              ) : (
                                tasks.filter(t => String(t.projectId) === String(activeProjectDetail.id)).map(t => (
                                  <div key={t.id} className="task-item" style={{ background: 'var(--bg-card-secondary)' }}>
                                    <input type="checkbox" className="task-checkbox" checked={t.isCompleted} onChange={() => handleToggleTask(t.id, t.isCompleted)} />
                                    <div className="task-content">
                                      <div className={`task-title ${t.isCompleted ? 'completed' : ''}`}>{t.title}</div>
                                      <div className="task-meta">Assigned to {t.assignedToName} • Due {t.dueDate}</div>
                                    </div>
                                    <span className={`task-priority priority-${t.priority.toLowerCase()}`}>{t.priority}</span>
                                  </div>
                                ))
                              )}
                            </div>
                          )}

                          {/* 4. Chat Tab */}
                          {activeProjectTab === 'chat' && (
                            <div className="chat-container" style={{ minHeight: '340px' }}>
                              <div className="chat-messages">
                                {messages.filter(m => String(m.projectId) === String(activeProjectDetail.id)).length === 0 ? (
                                  <div style={{ textAlign: 'center', padding: '40px 20px', color: 'var(--text-muted)' }}>
                                    <span className="icon" style={{ fontSize: '36px', color: 'var(--primary)', marginBottom: '8px' }}>forum</span>
                                    <p>No messages in this project thread yet. Send a message to start communicating with the team.</p>
                                  </div>
                                ) : (
                                  messages.filter(m => String(m.projectId) === String(activeProjectDetail.id)).map(m => (
                                    <div key={m.id} className={`chat-bubble ${m.senderRole === 'STAFF' ? 'staff' : 'client'}`}>
                                      <div style={{ fontSize: '11px', fontWeight: '700', marginBottom: '2px', opacity: 0.85 }}>{m.senderName} ({m.senderRole})</div>
                                      <div>{m.text}</div>
                                      <div style={{ fontSize: '10px', opacity: 0.6, marginTop: '4px', textAlign: 'right' }}>{m.timestamp || 'Just now'}</div>
                                    </div>
                                  ))
                                )}
                              </div>
                              <form onSubmit={handleSendMessage} className="chat-input-row">
                                <input type="text" className="form-input" placeholder="Type a message to project team..." value={chatMessage} onChange={e => setChatMessage(e.target.value)} />
                                <button type="submit" className="btn-primary"><span className="icon">send</span></button>
                              </form>
                            </div>
                          )}
                        </div>
                      </>
                    ) : (
                      <div style={{ textAlign: 'center', padding: '100px 20px', color: 'var(--text-muted)' }}>
                        <span className="icon" style={{ fontSize: '48px', color: 'var(--primary)', marginBottom: '12px' }}>touch_app</span>
                        <h3>Select a project from the left panel</h3>
                        <p style={{ fontSize: '13px' }}>View roadmap milestones, artifacts, tasks, and discussion streams.</p>
                      </div>
                    )}
                  </div>
                </div>
              )}

              {/* 1. Kanban Board View Mode */}
              {projectViewMode === 'kanban' && (
                <div style={{ display: 'grid', gridTemplateColumns: 'repeat(auto-fit, minmax(280px, 1fr))', gap: '20px', alignItems: 'start' }}>
                  {[
                    { id: 'planning', title: 'Planning & Specs', min: 0, max: 25, color: '#38BDF8', icon: 'architecture' },
                    { id: 'active', title: 'Active Sprints', min: 26, max: 70, color: '#0284C7', icon: 'developer_mode' },
                    { id: 'review', title: 'Review & Staging', min: 71, max: 99, color: '#F59E0B', icon: 'rate_review' },
                    { id: 'completed', title: 'Shipped & Live', min: 100, max: 100, color: '#10B981', icon: 'verified' }
                  ].map(column => {
                    const colProjects = filteredProjects.filter(p => {
                      const prog = Number(p.progress) || 0;
                      if (column.id === 'planning') return prog <= 25;
                      if (column.id === 'active') return prog > 25 && prog <= 70;
                      if (column.id === 'review') return prog > 70 && prog < 100;
                      return prog >= 100;
                    });

                    return (
                      <div key={column.id} style={{ background: 'var(--bg-card)', borderRadius: '16px', border: '1px solid var(--border-subtle)', padding: '16px', display: 'flex', flexDirection: 'column', gap: '14px' }}>
                        <div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', paddingBottom: '10px', borderBottom: '1px solid var(--border-subtle)' }}>
                          <div style={{ display: 'flex', alignItems: 'center', gap: '8px' }}>
                            <span className="icon" style={{ color: column.color, fontSize: '18px' }}>{column.icon}</span>
                            <span style={{ fontSize: '14px', fontWeight: '800' }}>{column.title}</span>
                          </div>
                          <span style={{ fontSize: '11px', fontWeight: '800', padding: '2px 8px', borderRadius: '9999px', background: `${column.color}22`, color: column.color }}>
                            {colProjects.length}
                          </span>
                        </div>

                        <div style={{ display: 'flex', flexDirection: 'column', gap: '12px', minHeight: '120px' }}>
                          {colProjects.length === 0 ? (
                            <div style={{ textAlign: 'center', padding: '24px 12px', color: 'var(--text-muted)', fontSize: '12px', border: '1px dashed var(--border-subtle)', borderRadius: '10px' }}>
                              No projects in this stage
                            </div>
                          ) : (
                            colProjects.map(p => {
                              const projDeliverables = deliverables.filter(d => String(d.projectId) === String(p.id));
                              const projTasks = tasks.filter(t => String(t.projectId) === String(p.id));
                              return (
                                <div
                                  key={p.id}
                                  className="bento-card"
                                  style={{ padding: '14px', cursor: 'pointer', display: 'flex', flexDirection: 'column', gap: '10px', background: 'var(--bg-card-secondary)', border: '1px solid var(--border-subtle)', transition: 'transform 0.15s ease' }}
                                  onClick={() => { setActiveProjectDetail(p); setProjectViewMode('split'); navigateTo('projects', p.id); chimeEngine.playPop(); }}
                                >
                                  <div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}>
                                    <span style={{ fontSize: '10px', fontWeight: '800', color: p.accentColorHex || '#10B981', textTransform: 'uppercase', background: 'rgba(255,255,255,0.06)', padding: '2px 6px', borderRadius: '4px' }}>
                                      {p.category}
                                    </span>
                                    <span style={{ fontSize: '11px', color: 'var(--text-muted)' }}>{p.deadline}</span>
                                  </div>

                                  <div>
                                    <div style={{ fontSize: '14px', fontWeight: '800', marginBottom: '2px' }}>{p.title}</div>
                                    <div style={{ fontSize: '11px', color: 'var(--text-muted)' }}>{p.clientName}</div>
                                  </div>

                                  <div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', fontSize: '11px', color: 'var(--text-muted)' }}>
                                    <span>Milestone</span>
                                    <span style={{ fontWeight: '800', color: 'var(--text-main)' }}>{p.progress}%</span>
                                  </div>
                                  <div className="progress-bar-container" style={{ height: '5px' }}>
                                    <div className="progress-bar-fill" style={{ width: `${p.progress}%`, background: p.accentColorHex || '#10B981' }}></div>
                                  </div>

                                  <div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', paddingTop: '6px', borderTop: '1px solid var(--border-subtle)', fontSize: '11px', color: 'var(--text-muted)' }}>
                                    <span>{projDeliverables.length} Builds</span>
                                    <span>{projTasks.filter(t => !t.isCompleted).length} Tasks</span>
                                  </div>
                                </div>
                              );
                            })
                          )}
                        </div>
                      </div>
                    );
                  })}
                </div>
              )}

              {/* 2. Grid Overview Mode */}
              {projectViewMode === 'grid' && (
                <div style={{ display: 'grid', gridTemplateColumns: 'repeat(auto-fill, minmax(340px, 1fr))', gap: '20px' }}>
                  {filteredProjects.map(p => {
                    const projDeliverables = deliverables.filter(d => String(d.projectId) === String(p.id));
                    const projTasks = tasks.filter(t => String(t.projectId) === String(p.id));

                    return (
                      <div
                        key={p.id}
                        className="bento-card"
                        style={{ padding: '22px', display: 'flex', flexDirection: 'column', gap: '16px', cursor: 'pointer', transition: 'all 0.2s' }}
                        onClick={() => { setActiveProjectDetail(p); setProjectViewMode('split'); navigateTo('projects', p.id); chimeEngine.playPop(); }}
                      >
                        <div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}>
                          <span style={{ fontSize: '11px', fontWeight: '800', color: p.accentColorHex || '#10B981', textTransform: 'uppercase', background: 'rgba(255,255,255,0.06)', padding: '3px 10px', borderRadius: '6px' }}>
                            {p.category}
                          </span>
                          <span style={{ fontSize: '11px', color: 'var(--text-muted)', display: 'flex', alignItems: 'center', gap: '4px' }}>
                            <span className="icon" style={{ fontSize: '14px' }}>calendar_month</span>
                            {p.deadline}
                          </span>
                        </div>

                        <div>
                          <h3 style={{ fontSize: '18px', fontWeight: '800', margin: '0 0 6px 0' }}>{p.title}</h3>
                          <p style={{ fontSize: '12px', color: 'var(--text-muted)', margin: 0 }}>Client: <strong style={{ color: 'var(--text-main)' }}>{p.clientName}</strong></p>
                        </div>

                        <p style={{ fontSize: '12px', color: 'var(--text-muted)', lineHeight: '1.5', margin: 0, display: '-webkit-box', WebkitLineClamp: 2, WebkitBoxOrient: 'vertical', overflow: 'hidden' }}>
                          {p.description || 'Enterprise architecture, mobile development, and automated CI/CD workflows.'}
                        </p>

                        <div>
                          <div style={{ display: 'flex', justifyContent: 'space-between', fontSize: '11px', color: 'var(--text-muted)', marginBottom: '6px' }}>
                            <span>Sprint Roadmap Completion</span>
                            <span style={{ fontWeight: '800', color: 'var(--text-main)' }}>{p.progress}%</span>
                          </div>
                          <div className="progress-bar-container" style={{ height: '8px' }}>
                            <div className="progress-bar-fill" style={{ width: `${p.progress}%`, background: p.accentColorHex || '#10B981' }}></div>
                          </div>
                        </div>

                        <div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', paddingTop: '10px', borderTop: '1px solid var(--border-subtle)', fontSize: '12px', color: 'var(--text-muted)' }}>
                          <span>{projDeliverables.length} Builds</span>
                          <span>{projTasks.filter(t => !t.isCompleted).length} Open Tasks</span>
                          <span style={{ color: 'var(--primary)', fontWeight: '700', display: 'inline-flex', alignItems: 'center', gap: '4px' }}>
                            Open Details <span className="icon" style={{ fontSize: '16px' }}>arrow_forward</span>
                          </span>
                        </div>
                      </div>
                    );
                  })}
                </div>
              )}

              {/* 3. Table Matrix View */}
              {projectViewMode === 'matrix' && (
                <div className="bento-card" style={{ padding: '0', overflow: 'hidden' }}>
                  <table style={{ width: '100%', borderCollapse: 'collapse', textAlign: 'left', fontSize: '13px' }}>
                    <thead>
                      <tr style={{ background: 'var(--bg-card-secondary)', borderBottom: '1px solid var(--border-subtle)', color: 'var(--text-muted)', fontSize: '11px', textTransform: 'uppercase', letterSpacing: '0.05em' }}>
                        <th style={{ padding: '14px 18px' }}>Project Title</th>
                        <th style={{ padding: '14px 18px' }}>Client Account</th>
                        <th style={{ padding: '14px 18px' }}>Category</th>
                        <th style={{ padding: '14px 18px' }}>Target Deadline</th>
                        <th style={{ padding: '14px 18px' }}>Milestone Progress</th>
                        <th style={{ padding: '14px 18px' }}>Builds / Tasks</th>
                        <th style={{ padding: '14px 18px', textAlign: 'right' }}>Actions</th>
                      </tr>
                    </thead>
                    <tbody>
                      {filteredProjects.map(p => {
                        const projDeliverables = deliverables.filter(d => String(d.projectId) === String(p.id));
                        const projTasks = tasks.filter(t => String(t.projectId) === String(p.id));
                        return (
                          <tr key={p.id} style={{ borderBottom: '1px solid var(--border-subtle)', transition: 'background 0.15s' }}>
                            <td style={{ padding: '14px 18px', fontWeight: '800' }}>
                              <div style={{ display: 'flex', alignItems: 'center', gap: '10px' }}>
                                <span style={{ width: '10px', height: '10px', borderRadius: '50%', background: p.accentColorHex || '#10B981' }}></span>
                                <span>{p.title}</span>
                              </div>
                            </td>
                            <td style={{ padding: '14px 18px', color: 'var(--text-muted)' }}>{p.clientName}</td>
                            <td style={{ padding: '14px 18px' }}>
                              <span style={{ fontSize: '10px', fontWeight: '800', color: p.accentColorHex || '#10B981', background: 'rgba(255,255,255,0.05)', padding: '2px 8px', borderRadius: '4px' }}>
                                {p.category}
                              </span>
                            </td>
                            <td style={{ padding: '14px 18px', color: 'var(--text-muted)' }}>{p.deadline}</td>
                            <td style={{ padding: '14px 18px', minWidth: '160px' }}>
                              <div style={{ display: 'flex', alignItems: 'center', gap: '10px' }}>
                                <div className="progress-bar-container" style={{ height: '6px', flex: 1 }}>
                                  <div className="progress-bar-fill" style={{ width: `${p.progress}%`, background: p.accentColorHex || '#10B981' }}></div>
                                </div>
                                <span style={{ fontSize: '11px', fontWeight: '800', width: '32px' }}>{p.progress}%</span>
                              </div>
                            </td>
                            <td style={{ padding: '14px 18px', color: 'var(--text-muted)', fontSize: '12px' }}>
                              {projDeliverables.length} Builds • {projTasks.length} Tasks
                            </td>
                            <td style={{ padding: '14px 18px', textAlign: 'right' }}>
                              <button
                                className="btn-secondary"
                                style={{ padding: '4px 10px', fontSize: '11px' }}
                                onClick={() => { setActiveProjectDetail(p); setProjectViewMode('split'); navigateTo('projects', p.id); chimeEngine.playPop(); }}
                              >
                                View Details
                              </button>
                            </td>
                          </tr>
                        );
                      })}
                    </tbody>
                  </table>
                </div>
              )}
            </div>
          )}

          {/* 3. DELIVERABLES & BUILDS */}
          {activeTab === 'deliverables' && (
            <div className="bento-card">
              <div className="bento-card-header">
                <div>
                  <div className="bento-card-title"><span className="icon" style={{ color: 'var(--primary)' }}>inventory_2</span><span>Deliverables & APK Staging Builds</span></div>
                  <p style={{ fontSize: '12px', color: 'var(--text-muted)', marginTop: '2px' }}>Review build artifacts, download test packages, and confirm production sign-offs</p>
                </div>
                <button className="btn-primary" onClick={() => setModalType('CREATE_DELIVERABLE')}><span className="icon">upload_file</span><span>Publish Build</span></button>
              </div>

              <div className="filter-pills">
                <button className={`filter-pill ${deliverableFilter === 'ALL' ? 'active' : ''}`} onClick={() => setDeliverableFilter('ALL')}>All Deliverables ({deliverables.length})</button>
                <button className={`filter-pill ${deliverableFilter === 'PENDING' ? 'active' : ''}`} onClick={() => setDeliverableFilter('PENDING')}>Pending Approval ({pendingApprovalsCount})</button>
                <button className={`filter-pill ${deliverableFilter === 'APPROVED' ? 'active' : ''}`} onClick={() => setDeliverableFilter('APPROVED')}>Certified / Approved</button>
                <button className={`filter-pill ${deliverableFilter === 'APK' ? 'active' : ''}`} onClick={() => setDeliverableFilter('APK')}>APK Builds</button>
                <button className={`filter-pill ${deliverableFilter === 'FIGMA' ? 'active' : ''}`} onClick={() => setDeliverableFilter('FIGMA')}>Figma Assets</button>
              </div>

              <div style={{ display: 'flex', flexDirection: 'column', gap: '12px' }}>
                {filteredDeliverables.map(d => (
                  <div key={d.id} className="deliverable-item">
                    <div className="badge-file-type">{d.fileType}</div>
                    <div className="deliverable-info">
                      <div style={{ display: 'flex', alignItems: 'center', gap: '10px' }}>
                        <span className="deliverable-title">{d.title}</span>
                        <span className={`status-badge status-${d.status.toLowerCase().replace('_', '-')}`}>{d.status.replace('_', ' ')}</span>
                      </div>
                      <div className="deliverable-meta">
                        Build v{d.buildNumber || '1.0'} • Submitted by {d.submittedBy || 'Engineering'} • {d.fileDetails || 'Package artifact'}
                      </div>
                      {d.changelog && (
                        <div style={{ fontSize: '12px', color: 'var(--text-muted)', background: 'var(--bg-card-secondary)', padding: '8px 12px', borderRadius: '8px', marginTop: '6px' }}>
                          <strong>Changelog:</strong> {d.changelog}
                        </div>
                      )}
                    </div>
                    <div className="deliverable-actions">
                      <a href={d.downloadUrl} target="_blank" rel="noopener noreferrer" className="btn-secondary">
                        <span className="icon">download</span><span>Download</span>
                      </a>
                      {d.status === 'PENDING_APPROVAL' && (
                        <>
                          <button className="btn-success" onClick={() => { setTargetDeliverable(d); setModalType('APPROVE_DELIV'); }}>Approve</button>
                          <button className="btn-danger" onClick={() => { setTargetDeliverable(d); setModalType('CHANGES_DELIV'); }}>Request Changes</button>
                        </>
                      )}
                    </div>
                  </div>
                ))}
              </div>
            </div>
          )}

          {/* 4. TASKS & ACTION ITEMS */}
          {activeTab === 'tasks' && (
            <div className="bento-card">
              <div className="bento-card-header">
                <div>
                  <div className="bento-card-title"><span className="icon" style={{ color: 'var(--rose)' }}>checklist</span><span>Tasks & Action Milestones</span></div>
                  <p style={{ fontSize: '12px', color: 'var(--text-muted)', marginTop: '2px' }}>Client sign-offs, security audits, and engineering tasks</p>
                </div>
                <button className="btn-primary" onClick={() => setModalType('CREATE_TASK')}><span className="icon">add_task</span><span>Assign Task</span></button>
              </div>

              <div className="filter-pills">
                <button className={`filter-pill ${taskFilter === 'ALL' ? 'active' : ''}`} onClick={() => setTaskFilter('ALL')}>All Tasks ({tasks.length})</button>
                <button className={`filter-pill ${taskFilter === 'PENDING' ? 'active' : ''}`} onClick={() => setTaskFilter('PENDING')}>Pending ({pendingTasksCount})</button>
                <button className={`filter-pill ${taskFilter === 'COMPLETED' ? 'active' : ''}`} onClick={() => setTaskFilter('COMPLETED')}>Completed</button>
                <button className={`filter-pill ${taskFilter === 'HIGH' ? 'active' : ''}`} onClick={() => setTaskFilter('HIGH')}>High Priority</button>
                <button className={`filter-pill ${taskFilter === 'CLIENT' ? 'active' : ''}`} onClick={() => setTaskFilter('CLIENT')}>Client Tasks</button>
                <button className={`filter-pill ${taskFilter === 'STAFF' ? 'active' : ''}`} onClick={() => setTaskFilter('STAFF')}>Staff Tasks</button>
              </div>

              <div style={{ display: 'flex', flexDirection: 'column', gap: '10px' }}>
                {filteredTasks.map(t => (
                  <div key={t.id} className="task-item">
                    <input type="checkbox" className="task-checkbox" checked={t.isCompleted} onChange={() => handleToggleTask(t.id, t.isCompleted)} />
                    <div className="task-content">
                      <div className={`task-title ${t.isCompleted ? 'completed' : ''}`}>{t.title}</div>
                      <div className="task-meta">
                        Assigned to <strong>{t.assignedToName}</strong> ({t.assignedToRole}) • Due: {t.dueDate}
                      </div>
                      {t.description && <div style={{ fontSize: '12px', color: 'var(--text-muted)', marginTop: '4px' }}>{t.description}</div>}
                    </div>
                    <span className={`task-priority priority-${t.priority.toLowerCase()}`}>{t.priority}</span>
                  </div>
                ))}
              </div>
            </div>
          )}

          {/* 5. MESSAGES & DISCUSSION */}
          {activeTab === 'messages' && (
            <div className="bento-card">
              <div className="bento-card-header" style={{ flexWrap: 'wrap', gap: '12px' }}>
                <div>
                  <div className="bento-card-title">
                    <span className="icon" style={{ color: 'var(--primary)' }}>forum</span>
                    <span>Discussion Stream & Team Messaging</span>
                  </div>
                  <p style={{ fontSize: '12px', color: 'var(--text-muted)', marginTop: '2px' }}>
                    Real-time bidirectional channel between Client Leads and Sneksoft Engineering
                  </p>
                </div>

                <div style={{ display: 'flex', alignItems: 'center', gap: '8px', flexWrap: 'wrap' }}>
                  {/* Push Notification Toggle Button */}
                  {pushPermission !== 'granted' ? (
                    <button 
                      className="btn-secondary" 
                      style={{ background: 'rgba(16, 185, 129, 0.15)', borderColor: 'rgba(16, 185, 129, 0.4)', color: '#10B981', fontSize: '12px' }}
                      onClick={requestPushPermission}
                    >
                      <span className="icon" style={{ fontSize: '16px' }}>notifications_active</span>
                      <span>Enable Push Notifications</span>
                    </button>
                  ) : (
                    <button 
                      className="btn-secondary" 
                      style={{ fontSize: '12px' }}
                      onClick={() => {
                        triggerPushAlert('🔔 Sneksoft Push Alert', 'Staging build APK and team feedback ready for sign-off');
                        showToast('Push alert sent to browser notification center!', 'success');
                      }}
                      title="Trigger a test browser push alert"
                    >
                      <span className="icon" style={{ fontSize: '16px', color: '#10B981' }}>notifications</span>
                      <span>Test Push Alert</span>
                    </button>
                  )}
                </div>
              </div>

              {/* Channels & Search Bar */}
              <div style={{ display: 'flex', flexDirection: 'column', gap: '10px', marginBottom: '14px' }}>
                <div style={{ display: 'flex', gap: '10px', flexWrap: 'wrap', alignItems: 'center', justifyContent: 'space-between' }}>
                  {/* Channel Filter Pills */}
                  <div className="filter-pills" style={{ margin: 0 }}>
                    <button 
                      className={`filter-pill ${selectedChannelId === 'ALL' ? 'active' : ''}`}
                      onClick={() => setSelectedChannelId('ALL')}
                    >
                      All Channels ({messages.length})
                    </button>
                    {projects.map(p => (
                      <button 
                        key={p.id}
                        className={`filter-pill ${selectedChannelId === p.id ? 'active' : ''}`}
                        onClick={() => setSelectedChannelId(p.id)}
                      >
                        {p.title}
                      </button>
                    ))}
                  </div>

                  {/* Message Search */}
                  <div style={{ position: 'relative', minWidth: '220px', flex: '1', maxWidth: '340px' }}>
                    <span className="icon" style={{ position: 'absolute', left: '10px', top: '50%', transform: 'translateY(-50%)', fontSize: '16px', color: 'var(--text-muted)' }}>search</span>
                    <input 
                      type="text" 
                      className="form-input" 
                      placeholder="Search messages or senders..." 
                      style={{ paddingLeft: '32px', fontSize: '12px', height: '34px' }}
                      value={messageSearch}
                      onChange={e => setMessageSearch(e.target.value)}
                    />
                    {messageSearch && (
                      <button 
                        onClick={() => setMessageSearch('')} 
                        style={{ position: 'absolute', right: '8px', top: '50%', transform: 'translateY(-50%)', background: 'none', border: 'none', cursor: 'pointer', color: 'var(--text-muted)' }}
                      >
                        <span className="icon" style={{ fontSize: '16px' }}>close</span>
                      </button>
                    )}
                  </div>
                </div>
              </div>

              <div className="chat-container">
                <div className="chat-messages" style={{ minHeight: '320px', maxHeight: '480px', overflowY: 'auto' }}>
                  {messages
                    .filter(m => {
                      if (selectedChannelId !== 'ALL' && m.projectId && m.projectId !== selectedChannelId) return false;
                      if (!messageSearch.trim()) return true;
                      const q = messageSearch.toLowerCase();
                      return (m.text || '').toLowerCase().includes(q) || (m.senderName || '').toLowerCase().includes(q) || (m.senderRole || '').toLowerCase().includes(q);
                    })
                    .map(m => {
                      const msgReactions = reactions[m.id] || {};
                      const isStaff = m.senderRole === 'STAFF';
                      return (
                        <div key={m.id} className={`chat-bubble ${isStaff ? 'staff' : 'client'}`} style={{ position: 'relative', group: 'true' }}>
                          <div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', marginBottom: '4px', gap: '8px' }}>
                            <div style={{ fontSize: '11px', fontWeight: '700', opacity: 0.9, display: 'flex', alignItems: 'center', gap: '6px' }}>
                              <span className="icon" style={{ fontSize: '14px' }}>{isStaff ? 'support_agent' : 'person'}</span>
                              <span>{m.senderName}</span>
                              <span style={{ fontSize: '9px', fontWeight: '800', background: isStaff ? 'rgba(59, 130, 246, 0.2)' : 'rgba(16, 185, 129, 0.2)', padding: '1px 5px', borderRadius: '4px' }}>
                                {m.senderRole}
                              </span>
                            </div>
                            <div style={{ display: 'flex', alignItems: 'center', gap: '4px' }}>
                              <button 
                                onClick={() => {
                                  navigator.clipboard.writeText(m.text);
                                  showToast('Message copied to clipboard', 'info');
                                }}
                                style={{ background: 'none', border: 'none', color: 'inherit', opacity: 0.6, cursor: 'pointer', padding: '2px' }}
                                title="Copy message"
                              >
                                <span className="icon" style={{ fontSize: '13px' }}>content_copy</span>
                              </button>
                              <button 
                                onClick={() => handleDeleteMessage(m.id)}
                                style={{ background: 'none', border: 'none', color: '#EF4444', opacity: 0.6, cursor: 'pointer', padding: '2px' }}
                                title="Delete message"
                              >
                                <span className="icon" style={{ fontSize: '13px' }}>delete</span>
                              </button>
                            </div>
                          </div>

                          <div style={{ whiteSpace: 'pre-wrap', lineHeight: '1.45', fontSize: '13px' }}>{m.text}</div>
                          
                          <div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', marginTop: '6px' }}>
                            {/* Emoji Reactions display & add buttons */}
                            <div style={{ display: 'flex', gap: '4px', flexWrap: 'wrap', alignItems: 'center' }}>
                              {['👍', '❤️', '🚀', '💡', '🔥'].map(emoji => {
                                const count = msgReactions[emoji] || 0;
                                return (
                                  <button
                                    key={emoji}
                                    onClick={() => handleReactMessage(m.id, emoji)}
                                    style={{
                                      background: count > 0 ? 'rgba(255,255,255,0.2)' : 'rgba(0,0,0,0.05)',
                                      border: '1px solid rgba(255,255,255,0.1)',
                                      borderRadius: '12px',
                                      padding: '2px 6px',
                                      fontSize: '11px',
                                      cursor: 'pointer',
                                      display: 'inline-flex',
                                      alignItems: 'center',
                                      gap: '3px'
                                    }}
                                  >
                                    <span>{emoji}</span>
                                    {count > 0 && <span style={{ fontSize: '10px', fontWeight: '700' }}>{count}</span>}
                                  </button>
                                );
                              })}
                            </div>
                            <div style={{ fontSize: '10px', opacity: 0.6 }}>{m.timestamp || 'Just now'}</div>
                          </div>
                        </div>
                      );
                    })}

                  {/* Real-time Typing Simulator */}
                  {isStaffTyping && (
                    <div className="chat-bubble staff" style={{ maxWidth: '280px', animation: 'pulse 1.5s infinite' }}>
                      <div style={{ display: 'flex', alignItems: 'center', gap: '6px', fontSize: '12px' }}>
                        <span className="icon" style={{ fontSize: '16px', color: '#3B82F6' }}>support_agent</span>
                        <span>Alex Chen (Staff Lead) is typing...</span>
                      </div>
                    </div>
                  )}
                </div>

                {/* Quick Prompts strip */}
                <div style={{ display: 'flex', gap: '6px', overflowX: 'auto', padding: '6px 0', borderTop: '1px solid var(--border-color)' }}>
                  {[
                    'Approved the latest build update! 👍',
                    'Could we get an ETA on the milestone deliverables?',
                    'Requesting changes on the UI mockup.',
                    'Passkeys & biometric credentials verified on device.'
                  ].map((p, idx) => (
                    <button
                      key={idx}
                      type="button"
                      onClick={() => setChatMessage(p)}
                      style={{
                        background: 'var(--bg-card-secondary)',
                        border: '1px solid var(--border-color)',
                        borderRadius: '16px',
                        padding: '4px 10px',
                        fontSize: '11px',
                        color: 'var(--text-muted)',
                        cursor: 'pointer',
                        whiteSpace: 'nowrap'
                      }}
                    >
                      {p}
                    </button>
                  ))}
                </div>

                {/* Attached Deliverable Pill if selected */}
                {attachedDeliverableWeb && (
                  <div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', background: 'rgba(16, 185, 129, 0.12)', border: '1px solid rgba(16, 185, 129, 0.3)', padding: '6px 10px', borderRadius: '8px', marginBottom: '6px' }}>
                    <div style={{ display: 'flex', alignItems: 'center', gap: '6px', fontSize: '12px', color: '#10B981', fontWeight: '600' }}>
                      <span className="icon" style={{ fontSize: '16px' }}>attachment</span>
                      <span>Attached: {attachedDeliverableWeb}</span>
                    </div>
                    <button onClick={() => setAttachedDeliverableWeb(null)} style={{ background: 'none', border: 'none', color: '#10B981', cursor: 'pointer' }}>
                      <span className="icon" style={{ fontSize: '14px' }}>close</span>
                    </button>
                  </div>
                )}

                <form onSubmit={handleSendMessage} className="chat-input-row">
                  {/* Attachment dropdown button */}
                  <div style={{ position: 'relative' }}>
                    <button
                      type="button"
                      className="btn-secondary"
                      style={{ padding: '8px 10px', height: '42px' }}
                      onClick={() => {
                        const items = ['Android Staging Build (v2.5.0 APK)', 'UI/UX Design Mockup Spec (Figma)', 'Security Audit & Passkey Log'];
                        const next = prompt('Select deliverable to attach:\n1. Android Staging Build (v2.5.0 APK)\n2. UI/UX Design Mockup Spec (Figma)\n3. Security Audit & Passkey Log\n\nEnter 1, 2, or 3:');
                        if (next === '1') setAttachedDeliverableWeb(items[0]);
                        else if (next === '2') setAttachedDeliverableWeb(items[1]);
                        else if (next === '3') setAttachedDeliverableWeb(items[2]);
                      }}
                      title="Attach project deliverable"
                    >
                      <span className="icon">attachment</span>
                    </button>
                  </div>

                  <input 
                    type="text" 
                    className="form-input" 
                    placeholder="Type a message to project team (press Enter to send)..." 
                    value={chatMessage} 
                    onChange={e => setChatMessage(e.target.value)} 
                  />
                  <button type="submit" className="btn-primary" disabled={!chatMessage.trim()}>
                    <span className="icon">send</span>
                    <span>Send</span>
                  </button>
                </form>
              </div>
            </div>
          )}

          {/* 6. STAFF & PASSKEYS */}
          {activeTab === 'staff' && (
            <div className="bento-card">
              <div className="bento-card-header">
                <div>
                  <div className="bento-card-title"><span className="icon" style={{ color: 'var(--purple)' }}>badge</span><span>Staff Roster & Userlist Scanner</span></div>
                  <p style={{ fontSize: '12px', color: 'var(--text-muted)' }}>
                    Scanning userlist for <strong>@sneksoft.dev</strong> and <strong>@rizewolf.com</strong> domains. All other accounts are classified as Clients.
                  </p>
                </div>
                <button className="btn-primary" onClick={() => setModalType('CREATE_STAFF')}><span className="icon">person_add</span><span>Enroll Staff</span></button>
              </div>

              {/* Policy & Domain Badges Banner */}
              <div style={{ display: 'flex', gap: '10px', alignItems: 'center', marginBottom: '16px', padding: '10px 14px', background: 'rgba(56, 189, 248, 0.08)', borderRadius: '10px', border: '1px solid rgba(56, 189, 248, 0.2)' }}>
                <span className="icon" style={{ color: 'var(--primary)', fontSize: '20px' }}>security</span>
                <div style={{ flex: 1, fontSize: '12px' }}>
                  <span style={{ fontWeight: '700', color: 'var(--primary)' }}>Corporate Domain Rule:</span> Anyone with an active <code>@sneksoft.dev</code> or <code>@rizewolf.com</code> address is recognized as internal Staff with elevated permissions.
                </div>
                <div style={{ display: 'flex', gap: '6px' }}>
                  <span style={{ fontSize: '10px', fontWeight: '800', padding: '2px 8px', borderRadius: '4px', background: 'rgba(56, 189, 248, 0.2)', color: 'var(--primary)' }}>sneksoft.dev</span>
                  <span style={{ fontSize: '10px', fontWeight: '800', padding: '2px 8px', borderRadius: '4px', background: 'rgba(139, 92, 246, 0.2)', color: 'var(--purple)' }}>rizewolf.com</span>
                </div>
              </div>

              <div style={{ display: 'grid', gridTemplateColumns: 'repeat(auto-fit, minmax(300px, 1fr))', gap: '16px' }}>
                {staff.map(s => {
                  const isRizewolf = (s.email || '').toLowerCase().includes('rizewolf.com');
                  return (
                    <div key={s.id} className="bento-card" style={{ padding: '18px', background: 'var(--bg-card-secondary)' }}>
                      <div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'flex-start', marginBottom: '12px' }}>
                        <div style={{ display: 'flex', alignItems: 'center', gap: '10px' }}>
                          <div className="staff-avatar" style={{ background: isRizewolf ? '#8B5CF6' : '#0284C7' }}>
                            {s.name.split(' ').map(n => n[0]).join('')}
                          </div>
                          <div>
                            <div style={{ display: 'flex', alignItems: 'center', gap: '6px' }}>
                              <span style={{ fontWeight: '700', fontSize: '14px' }}>{s.name}</span>
                              <span
                                style={{
                                  fontSize: '9px',
                                  fontWeight: '800',
                                  padding: '1px 5px',
                                  borderRadius: '4px',
                                  background: isRizewolf ? 'rgba(139, 92, 246, 0.2)' : 'rgba(56, 189, 248, 0.2)',
                                  color: isRizewolf ? 'var(--purple)' : 'var(--primary)'
                                }}
                              >
                                {isRizewolf ? 'rizewolf.com' : 'sneksoft.dev'}
                              </span>
                            </div>
                            <div style={{ fontSize: '11px', color: 'var(--text-muted)' }}>{s.email}</div>
                          </div>
                        </div>
                        <span className="status-badge" style={{ background: isRizewolf ? 'rgba(139, 92, 246, 0.15)' : 'rgba(56, 189, 248, 0.15)', color: isRizewolf ? 'var(--purple)' : 'var(--primary)' }}>
                          {s.role}
                        </span>
                      </div>

                      {/* Company & Domain Meta */}
                      <div style={{ fontSize: '11px', color: 'var(--text-muted)', marginBottom: '8px' }}>
                        Organization: <strong>{isRizewolf ? 'Rizewolf Engineering' : 'Sneksoft Technologies'}</strong>
                      </div>

                      {/* Assigned projects badge list */}
                      <div style={{ marginBottom: '10px' }}>
                        <div style={{ fontSize: '11px', color: 'var(--text-muted)', marginBottom: '4px', fontWeight: '600' }}>Active Project Assignments:</div>
                        <div style={{ display: 'flex', flexWrap: 'wrap', gap: '6px' }}>
                          {projects.filter(p => p.assignedStaff?.some(as => String(as.id) === String(s.id) || as.email === s.email)).length > 0 ? (
                            projects.filter(p => p.assignedStaff?.some(as => String(as.id) === String(s.id) || as.email === s.email)).map(p => (
                              <span
                                key={p.id}
                                style={{
                                  fontSize: '10px',
                                  fontWeight: '700',
                                  padding: '2px 8px',
                                  borderRadius: '6px',
                                  background: 'rgba(56, 189, 248, 0.12)',
                                  color: 'var(--primary)',
                                  border: '1px solid rgba(56, 189, 248, 0.2)'
                                }}
                              >
                                {p.title}
                              </span>
                            ))
                          ) : (
                            <span style={{ fontSize: '11px', color: 'var(--text-muted)', fontStyle: 'italic' }}>Unassigned to active projects</span>
                          )}
                        </div>
                      </div>

                      <div style={{ borderTop: '1px solid var(--border-subtle)', paddingTop: '10px', display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}>
                        <div style={{ display: 'flex', alignItems: 'center', gap: '6px', fontSize: '12px', color: s.isPasskeyEnrolled ? '#10B981' : 'var(--text-muted)' }}>
                          <span className="icon" style={{ fontSize: '16px' }}>{s.isPasskeyEnrolled ? 'fingerprint' : 'lock'}</span>
                          <span>{s.isPasskeyEnrolled ? 'Passkey Enrolled' : 'Standard Password'}</span>
                        </div>
                        <div style={{ display: 'flex', gap: '6px' }}>
                          <button
                            className="btn-primary"
                            style={{ padding: '4px 8px', fontSize: '11px' }}
                            onClick={() => {
                              setAssignStaffForm({ staffId: s.id, role: s.role });
                              setActiveProjectDetail(projects[0] || null);
                              setModalType('ASSIGN_STAFF');
                              chimeEngine.playPop();
                            }}
                          >
                            + Assign Project
                          </button>
                          <button 
                            className="btn-secondary" 
                            style={{ 
                              padding: '4px 10px', 
                              fontSize: '11px',
                              borderColor: s.isPasskeyEnrolled ? 'rgba(239, 68, 68, 0.4)' : 'rgba(16, 185, 129, 0.4)',
                              color: s.isPasskeyEnrolled ? '#F87171' : '#34D399',
                              display: 'inline-flex',
                              alignItems: 'center',
                              gap: '4px'
                            }} 
                            onClick={() => handleToggleStaffPasskey(s.id, s.isPasskeyEnrolled, s)}
                            title={s.isPasskeyEnrolled ? 'Revoke passkey biometric credentials' : 'Enroll biometric passkey'}
                          >
                            <span className="icon" style={{ fontSize: '13px' }}>{s.isPasskeyEnrolled ? 'block' : 'fingerprint'}</span>
                            <span>{s.isPasskeyEnrolled ? 'Revoke' : 'Enroll Passkey'}</span>
                          </button>
                        </div>
                      </div>
                    </div>
                  );
                })}
              </div>
            </div>
          )}

          {/* 7. CLIENT MANAGEMENT & CRM */}
          {activeTab === 'clients' && (
            <div>
              {/* CRM Hero Banner & Financial Metrics */}
              <div className="bento-hero">
                <div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'flex-start', flexWrap: 'wrap', gap: '16px' }}>
                  <div>
                    <div style={{ display: 'inline-flex', alignItems: 'center', gap: '6px', padding: '4px 10px', borderRadius: '9999px', background: 'rgba(56, 189, 248, 0.2)', color: 'var(--primary)', fontSize: '11px', fontWeight: '700', letterSpacing: '0.05em', marginBottom: '8px' }}>
                      <span className="icon" style={{ fontSize: '14px' }}>business</span>
                      ENTERPRISE CLIENT RELATIONSHIP MANAGEMENT (CRM)
                    </div>
                    <h2 style={{ fontSize: '26px', fontWeight: '800', letterSpacing: '-0.02em' }}>Corporate Accounts & Partner Directory</h2>
                    <p style={{ color: 'var(--text-muted)', fontSize: '13px', marginTop: '4px', maxWidth: '640px' }}>
                      Manage enterprise client accounts, execute signed PDF contracts & MSAs, track monthly retainers, monitor SLA guarantees, and associate engineering projects.
                    </p>
                  </div>
                  <div style={{ display: 'flex', gap: '10px' }}>
                    <button className="btn-primary" onClick={() => { setClientCreationStep(1); setModalType('CREATE_CLIENT'); chimeEngine.playPop(); }}>
                      <span className="icon">person_add</span><span>Add New Client (Multi-Step)</span>
                    </button>
                  </div>
                </div>

                <div className="hero-stats-grid">
                  <div className="hero-stat-card">
                    <div className="stat-icon-wrapper stat-icon-blue"><span className="icon">business</span></div>
                    <div><div className="stat-label">Total Accounts</div><div className="stat-value">{clients.length}</div></div>
                  </div>
                  <div className="hero-stat-card">
                    <div className="stat-icon-wrapper stat-icon-emerald"><span className="icon">verified_user</span></div>
                    <div><div className="stat-label">Enterprise Tier</div><div className="stat-value">{clients.filter(c => c.tier === 'ENTERPRISE').length}</div></div>
                  </div>
                  <div className="hero-stat-card">
                    <div className="stat-icon-wrapper stat-icon-amber"><span className="icon">payments</span></div>
                    <div>
                      <div className="stat-label">Monthly Retainers</div>
                      <div className="stat-value">
                        ${clients.reduce((acc, c) => {
                          const num = Number(String(c.monthlyRetainer || '0').replace(/[^0-9.-]+/g, ''));
                          return acc + (isNaN(num) ? 0 : num);
                        }, 0).toLocaleString()}/mo
                      </div>
                    </div>
                  </div>
                  <div className="hero-stat-card">
                    <div className="stat-icon-wrapper stat-icon-rose"><span className="icon">picture_as_pdf</span></div>
                    <div><div className="stat-label">Executed Contracts</div><div className="stat-value">{clients.length} Active</div></div>
                  </div>
                </div>
              </div>

              {/* Filter Bar */}
              <div className="crm-filter-bar" style={{ display: 'flex', gap: '12px', flexWrap: 'wrap', alignItems: 'center', marginBottom: '20px', padding: '12px 16px', background: 'var(--bg-card)', borderRadius: '12px', border: '1px solid var(--border-subtle)' }}>
                <div style={{ display: 'flex', alignItems: 'center', gap: '8px', flex: 1, minWidth: '220px' }}>
                  <span className="icon" style={{ color: 'var(--text-muted)' }}>search</span>
                  <input
                    type="text"
                    className="search-input"
                    placeholder="Search by company, contact, or industry..."
                    value={clientSearchQuery}
                    onChange={(e) => setClientSearchQuery(e.target.value)}
                    style={{ width: '100%' }}
                  />
                </div>

                <div style={{ display: 'flex', gap: '10px', alignItems: 'center', flexWrap: 'wrap' }}>
                  <select
                    className="form-select"
                    style={{ padding: '8px 12px', fontSize: '12px', minWidth: '150px' }}
                    value={clientTierFilter}
                    onChange={(e) => setClientTierFilter(e.target.value)}
                  >
                    <option value="ALL">All Account Tiers</option>
                    <option value="ENTERPRISE">Enterprise Tier</option>
                    <option value="STRATEGIC">Strategic Tier</option>
                    <option value="GROWTH">Growth Tier</option>
                    <option value="STARTUP">Startup Tier</option>
                  </select>

                  <select
                    className="form-select"
                    style={{ padding: '8px 12px', fontSize: '12px', minWidth: '140px' }}
                    value={clientStatusFilter}
                    onChange={(e) => setClientStatusFilter(e.target.value)}
                  >
                    <option value="ALL">All Statuses</option>
                    <option value="ACTIVE">Active</option>
                    <option value="ONBOARDING">Onboarding</option>
                  </select>
                </div>
              </div>

              {/* Clients Roster Cards Grid */}
              {filteredClients.length === 0 ? (
                <div className="bento-card" style={{ padding: '48px 24px', textAlign: 'center' }}>
                  <div style={{ width: '64px', height: '64px', borderRadius: '50%', background: 'rgba(56, 189, 248, 0.1)', color: 'var(--primary)', display: 'flex', alignItems: 'center', justifyContent: 'center', margin: '0 auto 16px' }}>
                    <span className="icon" style={{ fontSize: '32px' }}>business</span>
                  </div>
                  <h3 style={{ fontSize: '18px', fontWeight: '700', marginBottom: '6px' }}>No CRM Clients Found</h3>
                  <p style={{ fontSize: '13px', color: 'var(--text-muted)', maxWidth: '400px', margin: '0 auto 18px' }}>
                    No corporate client accounts match your active search or filter criteria.
                  </p>
                  <button className="btn-primary" onClick={() => { setClientCreationStep(1); setModalType('CREATE_CLIENT'); chimeEngine.playPop(); }}>
                    <span className="icon">person_add</span><span>Onboard New Client</span>
                  </button>
                </div>
              ) : (
                <div style={{ display: 'grid', gridTemplateColumns: 'repeat(auto-fit, minmax(360px, 1fr))', gap: '20px' }}>
                  {filteredClients.map(c => {
                    const assignedProjObjs = projects.filter(p => 
                      (c.assignedProjects || []).some(ap => String(ap) === String(p.id) || String(ap).toLowerCase() === (p.title || '').toLowerCase())
                    );
                    const isEnterprise = c.tier === 'ENTERPRISE';
                    const isStrategic = c.tier === 'STRATEGIC';
                    const pdfFileName = c.contractPdfName || `${(c.company || 'Client').replace(/\s+/g, '_')}_MSA_Agreement.pdf`;

                    return (
                      <div key={c.id} className="bento-card crm-client-card" style={{ padding: '20px', background: 'var(--bg-card-secondary)', position: 'relative', display: 'flex', flexDirection: 'column', gap: '14px' }}>
                        {/* Header row with company & tier */}
                        <div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'flex-start' }}>
                          <div style={{ display: 'flex', alignItems: 'center', gap: '12px' }}>
                            <div className="staff-avatar" style={{ background: c.avatarBg || (isEnterprise ? '#059669' : isStrategic ? '#0284C7' : '#7C3AED'), width: '42px', height: '42px', fontSize: '16px', fontWeight: '800' }}>
                              {(c.company || 'C').charAt(0)}
                            </div>
                            <div>
                              <div style={{ display: 'flex', alignItems: 'center', gap: '8px' }}>
                                <h3 style={{ fontSize: '17px', fontWeight: '800', margin: 0 }}>{c.company}</h3>
                                <span
                                  style={{
                                    fontSize: '10px',
                                    fontWeight: '800',
                                    padding: '2px 8px',
                                    borderRadius: '6px',
                                    background: isEnterprise ? 'rgba(16, 185, 129, 0.2)' : isStrategic ? 'rgba(56, 189, 248, 0.2)' : 'rgba(124, 58, 237, 0.2)',
                                    color: isEnterprise ? '#10B981' : isStrategic ? '#38BDF8' : '#A78BFA'
                                  }}
                                >
                                  {c.tier || 'ENTERPRISE'}
                                </span>
                              </div>
                              <div style={{ fontSize: '12px', color: 'var(--text-muted)', marginTop: '2px' }}>{c.industry || 'Technology Solutions'}</div>
                            </div>
                          </div>

                          <span
                            className="status-badge"
                            style={{
                              background: c.status === 'ACTIVE' ? 'rgba(16, 185, 129, 0.15)' : 'rgba(245, 158, 11, 0.15)',
                              color: c.status === 'ACTIVE' ? '#10B981' : '#F59E0B'
                            }}
                          >
                            {c.status || 'ACTIVE'}
                          </span>
                        </div>

                        {/* Primary Contact Person */}
                        <div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', padding: '10px 12px', background: 'var(--bg-card)', borderRadius: '10px', border: '1px solid var(--border-subtle)' }}>
                          <div style={{ display: 'flex', alignItems: 'center', gap: '10px', minWidth: 0 }}>
                            <div style={{ width: '32px', height: '32px', borderRadius: '50%', background: 'rgba(255,255,255,0.08)', display: 'flex', alignItems: 'center', justifyContent: 'center' }}>
                              <span className="icon" style={{ fontSize: '16px', color: 'var(--text-muted)' }}>person</span>
                            </div>
                            <div style={{ minWidth: 0 }}>
                              <div style={{ fontSize: '13px', fontWeight: '700' }}>{c.primaryContact}</div>
                              <div style={{ fontSize: '11px', color: 'var(--text-muted)', textOverflow: 'ellipsis', overflow: 'hidden', whiteSpace: 'nowrap' }}>
                                {c.email}
                              </div>
                            </div>
                          </div>

                          <div style={{ display: 'flex', gap: '6px' }}>
                            {c.email && (
                              <a href={`mailto:${c.email}`} className="btn-icon" style={{ width: '30px', height: '30px', borderRadius: '8px' }} title={`Email ${c.primaryContact}`}>
                                <span className="icon" style={{ fontSize: '15px' }}>email</span>
                              </a>
                            )}
                            {c.phone && (
                              <a href={`tel:${c.phone}`} className="btn-icon" style={{ width: '30px', height: '30px', borderRadius: '8px' }} title={`Call ${c.phone}`}>
                                <span className="icon" style={{ fontSize: '15px' }}>phone</span>
                              </a>
                            )}
                          </div>
                        </div>

                        {/* Financials & Billing Info */}
                        <div style={{ display: 'grid', gridTemplateColumns: '1fr 1fr', gap: '8px', fontSize: '12px' }}>
                          <div style={{ padding: '8px 10px', background: 'rgba(255,255,255,0.03)', borderRadius: '8px', border: '1px solid var(--border-subtle)' }}>
                            <div style={{ color: 'var(--text-muted)', fontSize: '10px', textTransform: 'uppercase', fontWeight: '700' }}>Monthly Retainer</div>
                            <div style={{ fontWeight: '800', color: '#10B981', marginTop: '2px', fontSize: '14px' }}>
                              {String(c.monthlyRetainer || '0').startsWith('$') ? c.monthlyRetainer : `$${c.monthlyRetainer || '0'}`}
                            </div>
                          </div>
                          <div style={{ padding: '8px 10px', background: 'rgba(255,255,255,0.03)', borderRadius: '8px', border: '1px solid var(--border-subtle)' }}>
                            <div style={{ color: 'var(--text-muted)', fontSize: '10px', textTransform: 'uppercase', fontWeight: '700' }}>Billing Status</div>
                            <div style={{ fontWeight: '700', color: 'var(--text-main)', marginTop: '2px' }}>{c.billingStatus || 'CURRENT'}</div>
                          </div>
                        </div>

                        {/* PDF Contract & Legal Document Box */}
                        <div style={{ padding: '10px 12px', background: 'rgba(239, 68, 68, 0.06)', borderRadius: '10px', border: '1px solid rgba(239, 68, 68, 0.2)', display: 'flex', alignItems: 'center', justifyContent: 'space-between', gap: '8px' }}>
                          <div style={{ display: 'flex', alignItems: 'center', gap: '8px', minWidth: 0 }}>
                            <span className="icon" style={{ color: '#EF4444', fontSize: '22px' }}>picture_as_pdf</span>
                            <div style={{ minWidth: 0 }}>
                              <div style={{ fontSize: '12px', fontWeight: '700', color: 'var(--text-main)', textOverflow: 'ellipsis', overflow: 'hidden', whiteSpace: 'nowrap' }}>
                                {pdfFileName}
                              </div>
                              <div style={{ fontSize: '10px', color: '#10B981', fontWeight: '700', display: 'flex', alignItems: 'center', gap: '4px', flexWrap: 'wrap' }}>
                                <span className="icon" style={{ fontSize: '12px' }}>verified</span>
                                <span>Executed & Signed ({c.contractPdfSize || '2.4 MB'})</span>
                              </div>
                            </div>
                          </div>

                          <div style={{ display: 'flex', gap: '4px' }}>
                            <button
                              type="button"
                              className="btn-secondary"
                              style={{ padding: '4px 8px', fontSize: '11px' }}
                              onClick={() => { setViewingContractClient(c); chimeEngine.playPop(); }}
                              title="View Executed PDF Contract"
                            >
                              <span className="icon" style={{ fontSize: '14px' }}>visibility</span>
                              <span>View</span>
                            </button>
                            <button
                              type="button"
                              className="btn-secondary"
                              style={{ padding: '4px 8px', fontSize: '11px' }}
                              onClick={() => handleDownloadContractPdf(c)}
                              title="Download PDF"
                            >
                              <span className="icon" style={{ fontSize: '14px' }}>download</span>
                            </button>
                          </div>
                        </div>

                        {/* Linked Projects */}
                        <div>
                          <div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', marginBottom: '6px' }}>
                            <div style={{ fontSize: '11px', color: 'var(--text-muted)', fontWeight: '700', textTransform: 'uppercase' }}>Active Projects ({assignedProjObjs.length}):</div>
                            <button
                              onClick={() => { setEditingClient(c); setModalType('ASSIGN_CLIENT_PROJECT'); chimeEngine.playPop(); }}
                              style={{ background: 'none', border: 'none', color: 'var(--primary)', fontSize: '11px', cursor: 'pointer', fontWeight: '700', display: 'flex', alignItems: 'center', gap: '2px' }}
                            >
                              <span className="icon" style={{ fontSize: '12px' }}>add_link</span>
                              <span>Assign</span>
                            </button>
                          </div>

                          <div style={{ display: 'flex', flexWrap: 'wrap', gap: '6px' }}>
                            {assignedProjObjs.length > 0 ? (
                              assignedProjObjs.map(p => (
                                <button
                                  key={p.id}
                                  onClick={() => { setActiveProjectDetail(p); navigateTo('projects', p.id); chimeEngine.playPop(); }}
                                  title="Jump to Project Details"
                                  style={{
                                    fontSize: '11px',
                                    fontWeight: '700',
                                    padding: '4px 9px',
                                    borderRadius: '6px',
                                    background: 'rgba(56, 189, 248, 0.12)',
                                    color: 'var(--primary)',
                                    border: '1px solid rgba(56, 189, 248, 0.25)',
                                    cursor: 'pointer',
                                    display: 'inline-flex',
                                    alignItems: 'center',
                                    gap: '4px'
                                  }}
                                >
                                  <span className="icon" style={{ fontSize: '12px' }}>folder</span>
                                  <span>{p.title}</span>
                                </button>
                              ))
                            ) : (
                              <span style={{ fontSize: '11px', color: 'var(--text-muted)', fontStyle: 'italic' }}>No projects assigned yet</span>
                            )}
                          </div>
                        </div>

                        {/* CRM Account Notes */}
                        {c.notes && (
                          <div style={{ fontSize: '11px', color: 'var(--text-muted)', background: 'rgba(0,0,0,0.2)', padding: '8px 10px', borderRadius: '8px', fontStyle: 'italic' }}>
                            "{c.notes}"
                          </div>
                        )}

                        {/* Footer Actions */}
                        <div style={{ borderTop: '1px solid var(--border-subtle)', paddingTop: '12px', marginTop: 'auto', display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}>
                          <div style={{ fontSize: '11px', color: 'var(--text-muted)' }}>
                            Term: {c.contractStart || '2026-01-01'} → {c.contractEnd || '2026-12-31'}
                          </div>

                          <div style={{ display: 'flex', gap: '8px' }}>
                            <button
                              className="btn-secondary"
                              style={{ padding: '4px 10px', fontSize: '11px' }}
                              onClick={() => {
                                setEditingClient(c);
                                setClientForm({
                                  company: c.company,
                                  primaryContact: c.primaryContact,
                                  email: c.email,
                                  phone: c.phone || '',
                                  industry: c.industry || 'Technology',
                                  tier: c.tier || 'GROWTH',
                                  status: c.status || 'ACTIVE',
                                  monthlyRetainer: c.monthlyRetainer || '5,000',
                                  billingStatus: c.billingStatus || 'CURRENT',
                                  contractStart: c.contractStart || '',
                                  notes: c.notes || '',
                                  address: c.address || ''
                                });
                                setModalType('EDIT_CLIENT');
                                chimeEngine.playPop();
                              }}
                            >
                              <span className="icon" style={{ fontSize: '13px' }}>edit</span>
                              <span>Edit</span>
                            </button>

                            <button
                              className="btn-secondary"
                              style={{ padding: '4px 8px', fontSize: '11px', color: '#EF4444', borderColor: 'rgba(239, 68, 68, 0.3)' }}
                              onClick={() => handleDeleteClient(c.id, c.company)}
                              title="Delete Client"
                            >
                              <span className="icon" style={{ fontSize: '14px' }}>delete</span>
                            </button>
                          </div>
                        </div>
                      </div>
                    );
                  })}
                </div>
              )}

              {/* CRM Activity Stream & Milestones */}
              <div className="bento-card" style={{ marginTop: '24px' }}>
                <div className="bento-card-header">
                  <div className="bento-card-title">
                    <span className="icon" style={{ color: 'var(--primary)' }}>history_toggle_off</span>
                    <span>CRM Real-Time Activity & Compliance Ledger</span>
                  </div>
                </div>
                <div style={{ display: 'flex', flexDirection: 'column', gap: '12px' }}>
                  <div style={{ display: 'flex', alignItems: 'center', gap: '12px', padding: '8px 12px', background: 'rgba(255,255,255,0.02)', borderRadius: '8px', border: '1px solid var(--border-subtle)' }}>
                    <span className="icon" style={{ color: '#10B981' }}>verified</span>
                    <div style={{ flex: 1, fontSize: '12px' }}>
                      <span style={{ fontWeight: '700' }}>Acme Corporation</span> executed 2026 Master Services Agreement (MSA) with 24/7 dedicated engineering SLA.
                    </div>
                    <span style={{ fontSize: '11px', color: 'var(--text-muted)' }}>Today</span>
                  </div>
                  <div style={{ display: 'flex', alignItems: 'center', gap: '12px', padding: '8px 12px', background: 'rgba(255,255,255,0.02)', borderRadius: '8px', border: '1px solid var(--border-subtle)' }}>
                    <span className="icon" style={{ color: '#38BDF8' }}>payments</span>
                    <div style={{ flex: 1, fontSize: '12px' }}>
                      <span style={{ fontWeight: '700' }}>Apex Global Systems</span> monthly engineering retainer verified for Q3 ($24,000/mo).
                    </div>
                    <span style={{ fontSize: '11px', color: 'var(--text-muted)' }}>2 hours ago</span>
                  </div>
                  <div style={{ display: 'flex', alignItems: 'center', gap: '12px', padding: '8px 12px', background: 'rgba(255,255,255,0.02)', borderRadius: '8px', border: '1px solid var(--border-subtle)' }}>
                    <span className="icon" style={{ color: '#F59E0B' }}>assignment_turned_in</span>
                    <div style={{ flex: 1, fontSize: '12px' }}>
                      <span style={{ fontWeight: '700' }}>Nexus Health Technologies</span> HIPAA audit compliance checklist initialized.
                    </div>
                    <span style={{ fontSize: '11px', color: 'var(--text-muted)' }}>Yesterday</span>
                  </div>
                </div>
              </div>
            </div>
          )}

          {/* 8. PROFILE & PREFERENCES */}
          {activeTab === 'profile' && (
            <div style={{ display: 'grid', gridTemplateColumns: 'minmax(300px, 400px) 1fr', gap: '24px' }}>
              {/* Profile Card & Avatar Selection */}
              <div className="bento-card">
                <div style={{ textAlign: 'center', padding: '12px 0 20px', borderBottom: '1px solid var(--border-subtle)' }}>
                  <div
                    style={{
                      width: '84px',
                      height: '84px',
                      borderRadius: '50%',
                      background: activeAvatar.bg,
                      color: '#FFFFFF',
                      display: 'flex',
                      alignItems: 'center',
                      justifyContent: 'center',
                      margin: '0 auto 12px',
                      boxShadow: '0 8px 24px rgba(0,0,0,0.3)',
                      overflow: 'hidden'
                    }}
                  >
                    {customAvatarUrl ? (
                      <img src={customAvatarUrl} alt="Avatar" style={{ width: '100%', height: '100%', objectFit: 'cover' }} />
                    ) : (
                      <span className="icon" style={{ fontSize: '42px' }}>{activeAvatar.icon}</span>
                    )}
                  </div>
                  <h3 style={{ fontSize: '18px', fontWeight: '800' }}>{currentUser.displayName}</h3>
                  <p style={{ fontSize: '12px', color: 'var(--text-muted)' }}>{currentUser.email}</p>
                  <div style={{ display: 'inline-block', marginTop: '6px', padding: '3px 12px', borderRadius: '9999px', background: 'rgba(16, 185, 129, 0.2)', color: '#10B981', fontSize: '11px', fontWeight: '700' }}>
                    {currentUser.role === 'STAFF' ? 'STAFF ARCHITECT' : 'CLIENT REPRESENTATIVE'}
                  </div>
                </div>

                <div style={{ marginTop: '16px' }}>
                  <div style={{ fontSize: '12px', fontWeight: '700', color: 'var(--text-muted)', textTransform: 'uppercase', marginBottom: '10px' }}>
                    Choose Avatar Preset
                  </div>
                  <div style={{ display: 'grid', gridTemplateColumns: 'repeat(4, 1fr)', gap: '8px', marginBottom: '16px' }}>
                    {AVATAR_PRESETS.map(p => (
                      <button
                        key={p.id}
                        type="button"
                        onClick={() => { setSelectedAvatarId(p.id); setCustomAvatarUrl(''); chimeEngine.playPop(); }}
                        style={{
                          height: '52px',
                          borderRadius: '12px',
                          background: p.bg,
                          border: selectedAvatarId === p.id && !customAvatarUrl ? '3px solid #FFFFFF' : '1px solid transparent',
                          color: '#FFFFFF',
                          cursor: 'pointer',
                          display: 'flex',
                          alignItems: 'center',
                          justifyContent: 'center',
                          boxShadow: selectedAvatarId === p.id ? '0 0 14px ' + p.bg : 'none'
                        }}
                        title={p.name}
                      >
                        <span className="icon" style={{ fontSize: '24px' }}>{p.icon}</span>
                      </button>
                    ))}
                  </div>

                  <div className="form-group">
                    <label className="form-label">Custom Avatar Image URL</label>
                    <input
                      type="url"
                      className="form-input"
                      placeholder="https://images.unsplash.com/photo-..."
                      value={customAvatarUrl}
                      onChange={(e) => setCustomAvatarUrl(e.target.value)}
                    />
                  </div>
                </div>
              </div>

              {/* Personal Details & Preferences Form */}
              <div className="bento-card">
                <div className="bento-card-header">
                  <div className="bento-card-title"><span className="icon" style={{ color: 'var(--primary)' }}>badge</span><span>Personal & Account Details</span></div>
                </div>

                <form onSubmit={handleSaveProfile} style={{ display: 'flex', flexDirection: 'column', gap: '14px' }}>
                  <div style={{ display: 'grid', gridTemplateColumns: '1fr 1fr', gap: '14px' }}>
                    <div className="form-group">
                      <label className="form-label">Full Name</label>
                      <input className="form-input" value={profileForm.displayName} onChange={e => setProfileForm({ ...profileForm, displayName: e.target.value })} required />
                    </div>
                    <div className="form-group">
                      <label className="form-label">Email Address</label>
                      <input type="email" className="form-input" value={profileForm.email} onChange={e => setProfileForm({ ...profileForm, email: e.target.value })} required />
                    </div>
                  </div>

                  <div style={{ display: 'grid', gridTemplateColumns: '1fr 1fr', gap: '14px' }}>
                    <div className="form-group">
                      <label className="form-label">Phone</label>
                      <input className="form-input" value={profileForm.phone} onChange={e => setProfileForm({ ...profileForm, phone: e.target.value })} />
                    </div>
                    <div className="form-group">
                      <label className="form-label">Role / Occupation</label>
                      <input className="form-input" value={profileForm.occupation} onChange={e => setProfileForm({ ...profileForm, occupation: e.target.value })} />
                    </div>
                  </div>

                  <div className="form-group">
                    <label className="form-label">Organization / Company</label>
                    <input className="form-input" value={profileForm.company} onChange={e => setProfileForm({ ...profileForm, company: e.target.value })} />
                  </div>

                  <div className="form-group">
                    <label className="form-label">Corporate Address</label>
                    <input className="form-input" value={profileForm.address} onChange={e => setProfileForm({ ...profileForm, address: e.target.value })} />
                  </div>

                  <div style={{ borderTop: '1px solid var(--border-subtle)', paddingTop: '16px', display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}>
                    <button type="button" className="btn-secondary" onClick={() => { showToast('Password reset link sent to ' + currentUser.email, 'info'); chimeEngine.playDing(); }}>
                      <span className="icon">lock_reset</span><span>Reset Password</span>
                    </button>

                    <button type="submit" className="btn-primary">
                      <span className="icon">save</span><span>Save Profile Changes</span>
                    </button>
                  </div>
                </form>

                {/* Acoustic Chimes & Sounds */}
                <div style={{ marginTop: '24px', borderTop: '1px solid var(--border-subtle)', paddingTop: '16px' }}>
                  <h4 style={{ fontSize: '14px', fontWeight: '700', marginBottom: '6px' }}>Audio & Acoustic Chimes</h4>
                  <p style={{ fontSize: '12px', color: 'var(--text-muted)', marginBottom: '14px' }}>Web Audio Synthesizer chimes provide immediate haptic feedback for key operations.</p>
                  <div style={{ display: 'flex', gap: '10px', flexWrap: 'wrap', alignItems: 'center' }}>
                    <button type="button" className="btn-secondary" onClick={() => chimeEngine.playSuccess()}>🔔 Test Success Chime</button>
                    <button type="button" className="btn-secondary" onClick={() => chimeEngine.playAlert()}>⚠️ Test Alert Chime</button>
                    <button type="button" className="btn-secondary" onClick={() => chimeEngine.playPop()}>✨ Test Pop Chime</button>
                  </div>
                </div>
              </div>
            </div>
          )}

          {/* 9. ANALYTICS & TELEMETRY */}
          {activeTab === 'analytics' && (
            <div>
              <div className="bento-hero">
                <div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'flex-start', flexWrap: 'wrap', gap: '16px' }}>
                  <div>
                    <div style={{ display: 'inline-flex', alignItems: 'center', gap: '6px', padding: '4px 10px', borderRadius: '9999px', background: 'rgba(56, 189, 248, 0.2)', color: '#38BDF8', fontSize: '11px', fontWeight: '700', letterSpacing: '0.05em', marginBottom: '8px' }}>
                      <span className="icon" style={{ fontSize: '14px' }}>monitoring</span>
                      EXECUTIVE TELEMETRY & SYSTEM ANALYTICS
                    </div>
                    <h2 style={{ fontSize: '26px', fontWeight: '800', letterSpacing: '-0.02em' }}>Platform Insights & Verification Rate</h2>
                    <p style={{ color: 'var(--text-muted)', fontSize: '13px', marginTop: '4px', maxWidth: '640px' }}>
                      Real-time audit telemetry, API response performance, build verification health, and Firebase persistence logs.
                    </p>
                  </div>
                  <button className="btn-secondary" onClick={() => fetchData()}><span className="icon">refresh</span><span>Refresh Data</span></button>
                </div>

                <div className="hero-stats-grid">
                  <div className="hero-stat-card">
                    <div className="stat-icon-wrapper stat-icon-emerald"><span className="icon">verified</span></div>
                    <div><div className="stat-label">Build Acceptance</div><div className="stat-value">{analytics?.portfolio?.verificationRate || '98.4%'}</div></div>
                  </div>
                  <div className="hero-stat-card">
                    <div className="stat-icon-wrapper stat-icon-blue"><span className="icon">speed</span></div>
                    <div><div className="stat-label">API Gateway Latency</div><div className="stat-value">{analytics?.system?.averageResponseTime || '34ms'}</div></div>
                  </div>
                  <div className="hero-stat-card">
                    <div className="stat-icon-wrapper stat-icon-amber"><span className="icon">cloud_sync</span></div>
                    <div><div className="stat-label">Firebase Storage Sync</div><div className="stat-value">100% Active</div></div>
                  </div>
                  <div className="hero-stat-card">
                    <div className="stat-icon-wrapper stat-icon-rose"><span className="icon">security</span></div>
                    <div><div className="stat-label">Audit Logs Logged</div><div className="stat-value">{analytics?.auditTrail?.totalLogged || '128'}</div></div>
                  </div>
                </div>
              </div>

              <div className="bento-grid-2col">
                {/* Security Audit Trail */}
                <div className="bento-card">
                  <div className="bento-card-header">
                    <div className="bento-card-title"><span className="icon" style={{ color: 'var(--primary)' }}>security</span><span>Security & Operations Audit Trail</span></div>
                  </div>
                  <div style={{ display: 'flex', flexDirection: 'column', gap: '10px' }}>
                    {[
                      { action: 'CONTRACT_UPLOAD', user: 'Lead Architect', detail: 'Uploaded PDF contract for corporate onboarding to Firebase Storage bucket', time: 'Just now', icon: 'picture_as_pdf', color: '#10B981' },
                      { action: 'FIRESTORE_WRITE', user: 'CRM Gateway', detail: 'Synchronized corporate customer metadata to Cloud Firestore collections', time: '3 mins ago', icon: 'local_fire_department', color: '#F59E0B' },
                      { action: 'BUILD_CERTIFIED', user: 'Rachel Vance', detail: 'Signed off on Android Staging APK v2.5.0 milestone deliverable', time: '25 mins ago', icon: 'verified', color: '#38BDF8' },
                      { action: 'BIOMETRIC_AUTH', user: 'Alex Chen', detail: 'WebAuthn passkey authenticated for staff biometric security role', time: '1 hr ago', icon: 'fingerprint', color: '#8B5CF6' }
                    ].map((log, idx) => (
                      <div key={idx} style={{ display: 'flex', alignItems: 'center', gap: '12px', padding: '10px 12px', background: 'rgba(255,255,255,0.02)', borderRadius: '10px', border: '1px solid var(--border-subtle)' }}>
                        <span className="icon" style={{ color: log.color, fontSize: '20px' }}>{log.icon}</span>
                        <div style={{ flex: 1 }}>
                          <div style={{ fontSize: '13px', fontWeight: '700' }}>{log.action} • <span style={{ fontWeight: '400', color: 'var(--text-muted)' }}>{log.user}</span></div>
                          <div style={{ fontSize: '12px', color: 'var(--text-muted)' }}>{log.detail}</div>
                        </div>
                        <div style={{ fontSize: '11px', color: 'var(--text-muted)' }}>{log.time}</div>
                      </div>
                    ))}
                  </div>
                </div>

                {/* Cloud & Infrastructure Performance */}
                <div className="bento-card">
                  <div className="bento-card-header">
                    <div className="bento-card-title"><span className="icon" style={{ color: '#10B981' }}>cloud_done</span><span>Cloud Infrastructure Diagnostics</span></div>
                  </div>
                  <div style={{ display: 'flex', flexDirection: 'column', gap: '14px' }}>
                    <div>
                      <div style={{ display: 'flex', justifyContent: 'space-between', fontSize: '12px', marginBottom: '6px' }}>
                        <span>Node.js Memory Utilization</span>
                        <span style={{ fontWeight: '700', color: '#10B981' }}>38.4 MB / 512 MB</span>
                      </div>
                      <div className="progress-bar-container"><div className="progress-bar-fill" style={{ width: '15%', background: '#10B981' }}></div></div>
                    </div>
                    <div>
                      <div style={{ display: 'flex', justifyContent: 'space-between', fontSize: '12px', marginBottom: '6px' }}>
                        <span>Firestore REST Connection Health</span>
                        <span style={{ fontWeight: '700', color: '#38BDF8' }}>Online (Zero Latency)</span>
                      </div>
                      <div className="progress-bar-container"><div className="progress-bar-fill" style={{ width: '100%', background: '#38BDF8' }}></div></div>
                    </div>
                    <div>
                      <div style={{ display: 'flex', justifyContent: 'space-between', fontSize: '12px', marginBottom: '6px' }}>
                        <span>Firebase Cloud Storage Bucket SLA</span>
                        <span style={{ fontWeight: '700', color: '#F59E0B' }}>99.99% Availability</span>
                      </div>
                      <div className="progress-bar-container"><div className="progress-bar-fill" style={{ width: '99%', background: '#F59E0B' }}></div></div>
                    </div>
                  </div>
                </div>
              </div>
            </div>
          )}

          {/* 10. WEBHOOKS & EVENTS */}
          {activeTab === 'webhooks' && (
            <div>
              <div className="bento-hero">
                <div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'flex-start', flexWrap: 'wrap', gap: '16px' }}>
                  <div>
                    <div style={{ display: 'inline-flex', alignItems: 'center', gap: '6px', padding: '4px 10px', borderRadius: '9999px', background: 'rgba(139, 92, 246, 0.2)', color: '#A78BFA', fontSize: '11px', fontWeight: '700', letterSpacing: '0.05em', marginBottom: '8px' }}>
                      <span className="icon" style={{ fontSize: '14px' }}>webhook</span>
                      DEVELOPER INTEGRATIONS & REAL-TIME WEBHOOKS
                    </div>
                    <h2 style={{ fontSize: '26px', fontWeight: '800', letterSpacing: '-0.02em' }}>Outbound Event Subscriptions</h2>
                    <p style={{ color: 'var(--text-muted)', fontSize: '13px', marginTop: '4px', maxWidth: '640px' }}>
                      Configure HMAC SHA-256 signed HTTP payloads for project updates, build sign-offs, and customer CRM contract executions.
                    </p>
                  </div>
                  <button className="btn-primary" onClick={() => { showToast('Test ping dispatched to active webhook endpoints', 'success'); }}><span className="icon">send</span><span>Dispatch Test Ping</span></button>
                </div>
              </div>

              <div className="bento-card">
                <div className="bento-card-header">
                  <div className="bento-card-title"><span className="icon" style={{ color: '#8B5CF6' }}>cable</span><span>Configured Endpoints ({webhooks.length || 2})</span></div>
                </div>
                <div style={{ display: 'flex', flexDirection: 'column', gap: '12px' }}>
                  {[
                    { url: 'https://ci-cd.sneksoft.dev/api/v1/webhooks/builds', event: 'deliverable.created', status: 'ACTIVE', lastPing: '2 mins ago' },
                    { url: 'https://crm-sync.apexglobal.io/hooks/client-signed', event: 'contract.signed', status: 'ACTIVE', lastPing: '15 mins ago' }
                  ].map((hook, i) => (
                    <div key={i} style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', padding: '12px 14px', background: 'rgba(255,255,255,0.02)', borderRadius: '10px', border: '1px solid var(--border-subtle)', flexWrap: 'wrap', gap: '10px' }}>
                      <div>
                        <div style={{ display: 'flex', alignItems: 'center', gap: '8px' }}>
                          <span style={{ fontSize: '11px', fontWeight: '800', background: 'rgba(16, 185, 129, 0.15)', color: '#10B981', padding: '2px 8px', borderRadius: '6px' }}>{hook.status}</span>
                          <span style={{ fontSize: '13px', fontWeight: '700', fontFamily: 'monospace' }}>{hook.url}</span>
                        </div>
                        <div style={{ fontSize: '12px', color: 'var(--text-muted)', marginTop: '4px' }}>Subscribed Event: <code>{hook.event}</code> • Last ping: {hook.lastPing}</div>
                      </div>
                      <button className="btn-secondary" style={{ padding: '4px 10px', fontSize: '12px' }} onClick={() => showToast(`Payload tested for ${hook.event}`, 'success')}>Test Event</button>
                    </div>
                  ))}
                </div>
              </div>
            </div>
          )}

          {/* 11. SYSTEM DIAGNOSTICS & HEALTH */}
          {activeTab === 'health' && (
            <div>
              <div className="bento-hero">
                <div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'flex-start', flexWrap: 'wrap', gap: '16px' }}>
                  <div>
                    <div style={{ display: 'inline-flex', alignItems: 'center', gap: '6px', padding: '4px 10px', borderRadius: '9999px', background: 'rgba(16, 185, 129, 0.2)', color: '#10B981', fontSize: '11px', fontWeight: '700', letterSpacing: '0.05em', marginBottom: '8px' }}>
                      <span className="icon" style={{ fontSize: '14px' }}>health_and_safety</span>
                      GATEWAY HEALTH & SERVICE STATUS
                    </div>
                    <h2 style={{ fontSize: '26px', fontWeight: '800', letterSpacing: '-0.02em' }}>System Operations & Node Diagnostics</h2>
                    <p style={{ color: 'var(--text-muted)', fontSize: '13px', marginTop: '4px', maxWidth: '640px' }}>
                      Live connectivity checks for Cloud Run backend, Firestore REST storage, and Firebase multi-tenant buckets.
                    </p>
                  </div>
                  <button className="btn-secondary" onClick={() => fetchData()}><span className="icon">refresh</span><span>Run Diagnostics</span></button>
                </div>
              </div>

              <div className="bento-grid-2col">
                <div className="bento-card">
                  <div className="bento-card-header"><div className="bento-card-title"><span className="icon" style={{ color: '#10B981' }}>dns</span><span>Active Microservices</span></div></div>
                  <div style={{ display: 'flex', flexDirection: 'column', gap: '10px' }}>
                    {[
                      { name: 'Cloud Run Web Server', status: 'HEALTHY', latency: '12ms', icon: 'memory' },
                      { name: 'Firebase Firestore Engine', status: 'HEALTHY', latency: '45ms', icon: 'local_fire_department' },
                      { name: 'Firebase Storage PDF Bucket', status: 'HEALTHY', latency: '68ms', icon: 'folder_zip' },
                      { name: 'Server-Sent Events (SSE) Bus', status: 'CONNECTED', latency: '0ms', icon: 'sync' }
                    ].map((svc, idx) => (
                      <div key={idx} style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', padding: '10px 12px', background: 'rgba(255,255,255,0.02)', borderRadius: '10px', border: '1px solid var(--border-subtle)' }}>
                        <div style={{ display: 'flex', alignItems: 'center', gap: '10px' }}>
                          <span className="icon" style={{ color: '#10B981' }}>{svc.icon}</span>
                          <span style={{ fontSize: '13px', fontWeight: '700' }}>{svc.name}</span>
                        </div>
                        <div style={{ display: 'flex', alignItems: 'center', gap: '8px' }}>
                          <span style={{ fontSize: '11px', color: 'var(--text-muted)' }}>{svc.latency}</span>
                          <span style={{ fontSize: '10px', fontWeight: '800', background: 'rgba(16, 185, 129, 0.2)', color: '#10B981', padding: '2px 8px', borderRadius: '4px' }}>{svc.status}</span>
                        </div>
                      </div>
                    ))}
                  </div>
                </div>

                <div className="bento-card">
                  <div className="bento-card-header"><div className="bento-card-title"><span className="icon" style={{ color: 'var(--primary)' }}>terminal</span><span>Quick Actions & Maintenance</span></div></div>
                  <div style={{ display: 'flex', flexDirection: 'column', gap: '10px' }}>
                    <button className="btn-secondary" style={{ justifyContent: 'flex-start' }} onClick={() => { showToast('Cache cleared successfully', 'success'); }}><span className="icon">cached</span><span>Clear Local Portal Cache</span></button>
                    <button className="btn-secondary" style={{ justifyContent: 'flex-start' }} onClick={() => { showToast('Triggering full Firestore collection sync...', 'info'); fetchData(); }}><span className="icon">sync</span><span>Force Full Firestore Sync</span></button>
                    <button className="btn-secondary" style={{ justifyContent: 'flex-start' }} onClick={() => { showToast('Generated mock contract preview', 'info'); }}><span className="icon">picture_as_pdf</span><span>Validate PDF Engine</span></button>
                  </div>
                </div>
              </div>
            </div>
          )}
        </div>
      </main>

      {/* Floating Bottom Navigation Pill (Mirroring Android App MainPortalContainer) */}
      <div className="bottom-nav-pill-wrapper">
        <div className="bottom-nav-pill">
          <button
            className={`bottom-pill-item ${activeTab === 'dashboard' ? 'active' : ''}`}
            onClick={() => { navigateTo('dashboard'); chimeEngine.playPop(); }}
            title="Dashboard Overview"
          >
            <span className="icon pill-icon">dashboard</span>
            <span className="pill-label">Overview</span>
          </button>

          <button
            className={`bottom-pill-item ${activeTab === 'projects' ? 'active' : ''}`}
            onClick={() => { navigateTo('projects'); chimeEngine.playPop(); }}
            title="Projects Hub"
          >
            <div style={{ position: 'relative' }}>
              <span className="icon pill-icon">folder_special</span>
              {projects.length > 0 && <span className="pill-badge">{projects.length}</span>}
            </div>
            <span className="pill-label">Projects</span>
          </button>

          <button
            className={`bottom-pill-item ${activeTab === 'deliverables' ? 'active' : ''}`}
            onClick={() => { navigateTo('deliverables'); chimeEngine.playPop(); }}
            title="Deliverables & Builds"
          >
            <div style={{ position: 'relative' }}>
              <span className="icon pill-icon">inventory_2</span>
              {pendingApprovalsCount > 0 && <span className="pill-badge badge-urgent">{pendingApprovalsCount}</span>}
            </div>
            <span className="pill-label">Deliverables</span>
          </button>

          <button
            className={`bottom-pill-item ${activeTab === 'tasks' ? 'active' : ''}`}
            onClick={() => { navigateTo('tasks'); chimeEngine.playPop(); }}
            title="Action Items"
          >
            <div style={{ position: 'relative' }}>
              <span className="icon pill-icon">assignment</span>
              {pendingTasksCount > 0 && <span className="pill-badge">{pendingTasksCount}</span>}
            </div>
            <span className="pill-label">Tasks</span>
          </button>

          <button
            className={`bottom-pill-item ${activeTab === 'clients' ? 'active' : ''}`}
            onClick={() => { navigateTo('clients'); chimeEngine.playPop(); }}
            title="Client Management & CRM"
          >
            <div style={{ position: 'relative' }}>
              <span className="icon pill-icon">business</span>
              {clients.length > 0 && <span className="pill-badge" style={{ background: '#38BDF8' }}>{clients.length}</span>}
            </div>
            <span className="pill-label">CRM</span>
          </button>

          <button
            className={`bottom-pill-item ${activeTab === 'staff' ? 'active' : ''}`}
            onClick={() => { navigateTo('staff'); chimeEngine.playPop(); }}
            title="Staff Roster & Biometrics"
          >
            <div style={{ position: 'relative' }}>
              <span className="icon pill-icon">badge</span>
              {staff.length > 0 && <span className="pill-badge" style={{ background: '#8B5CF6' }}>{staff.length}</span>}
            </div>
            <span className="pill-label">Staff</span>
          </button>

          <button
            className={`bottom-pill-item ${activeTab === 'messages' ? 'active' : ''}`}
            onClick={() => { navigateTo('messages'); chimeEngine.playPop(); }}
            title="Discussions"
          >
            <div style={{ position: 'relative' }}>
              <span className="icon pill-icon">forum</span>
              {messages.length > 0 && <span className="pill-badge">{messages.length}</span>}
            </div>
            <span className="pill-label">Discussions</span>
          </button>
        </div>
      </div>

      {/* --- MODALS --- */}
      {/* 1. Create Project Modal */}
      {modalType === 'CREATE_PROJECT' && (
        <div className="modal-overlay" onClick={() => setModalType(null)}>
          <div className="modal-content" onClick={e => e.stopPropagation()}>
            <div className="modal-header">
              <h3 className="modal-title">Publish New Client Project</h3>
              <button className="btn-icon" onClick={() => setModalType(null)}><span className="icon">close</span></button>
            </div>
            <form onSubmit={handleCreateProject} style={{ display: 'flex', flexDirection: 'column', gap: '14px' }}>
              {/* Staff Auto-Assignment Notice */}
              {((currentUser?.email || '').toLowerCase().endsWith('@sneksoft.dev') || (currentUser?.email || '').toLowerCase().endsWith('@rizewolf.com') || currentUser?.isAdmin || currentUser?.isStaff) && (
                <div style={{ background: 'rgba(16, 185, 129, 0.12)', border: '1px solid rgba(16, 185, 129, 0.3)', borderRadius: '10px', padding: '10px 12px', display: 'flex', alignItems: 'center', gap: '10px', fontSize: '12px', color: '#10B981' }}>
                  <span className="icon" style={{ fontSize: '20px' }}>badge</span>
                  <div>
                    <strong>Staff Auto-Assignment:</strong> As a verified staff member (<em>{currentUser?.displayName || currentUser?.email}</em>), you will be automatically assigned to this project upon creation.
                  </div>
                </div>
              )}

              <div className="form-group">
                <label className="form-label">Project Title</label>
                <input required className="form-input" placeholder="e.g. Apex Android Portal" value={projectForm.title} onChange={e => setProjectForm({ ...projectForm, title: e.target.value })} />
              </div>
              <div className="form-group">
                <label className="form-label">Client Partner Name</label>
                <input required className="form-input" placeholder="e.g. Apex Global Corp" value={projectForm.clientName} onChange={e => setProjectForm({ ...projectForm, clientName: e.target.value })} />
              </div>
              <div className="form-group">
                <label className="form-label">Category</label>
                <select className="form-select" value={projectForm.category} onChange={e => setProjectForm({ ...projectForm, category: e.target.value })}>
                  <option value="Mobile App Development">Mobile App Development</option>
                  <option value="Security Architecture">Security Architecture</option>
                  <option value="Backend Infrastructure">Backend Infrastructure</option>
                  <option value="AI / ML Solutions">AI / ML Solutions</option>
                </select>
              </div>
              <div className="form-group">
                <label className="form-label">Project Scope Description</label>
                <textarea className="form-textarea" placeholder="Detailed architectural goals..." value={projectForm.description} onChange={e => setProjectForm({ ...projectForm, description: e.target.value })}></textarea>
              </div>
              <button type="submit" className="btn-primary" style={{ marginTop: '8px' }}>Publish Project</button>
            </form>
          </div>
        </div>
      )}

      {/* 2. Publish Deliverable Modal */}
      {modalType === 'CREATE_DELIVERABLE' && (
        <div className="modal-overlay" onClick={() => setModalType(null)}>
          <div className="modal-content" onClick={e => e.stopPropagation()}>
            <div className="modal-header">
              <h3 className="modal-title">Publish Deliverable / APK Build</h3>
              <button className="btn-icon" onClick={() => setModalType(null)}><span className="icon">close</span></button>
            </div>
            <form onSubmit={handleCreateDeliverable} style={{ display: 'flex', flexDirection: 'column', gap: '14px' }}>
              <div className="form-group">
                <label className="form-label">Associated Project</label>
                <select className="form-select" value={deliverableForm.projectId} onChange={e => setDeliverableForm({ ...deliverableForm, projectId: e.target.value })}>
                  {projects.map(p => <option key={p.id} value={p.id}>{p.title}</option>)}
                </select>
              </div>
              <div className="form-group">
                <label className="form-label">Deliverable Title</label>
                <input required className="form-input" placeholder="e.g. Staging APK v2.5.0" value={deliverableForm.title} onChange={e => setDeliverableForm({ ...deliverableForm, title: e.target.value })} />
              </div>
              <div className="form-group">
                <label className="form-label">File Type</label>
                <select className="form-select" value={deliverableForm.fileType} onChange={e => setDeliverableForm({ ...deliverableForm, fileType: e.target.value })}>
                  <option value="APK">APK (Android Package)</option>
                  <option value="FIGMA">FIGMA Design File</option>
                  <option value="ZIP">ZIP Source Archive</option>
                  <option value="DOC">Technical Specification PDF</option>
                </select>
              </div>
              <div className="form-group">
                <label className="form-label">Artifact Download / Review URL</label>
                <input required className="form-input" value={deliverableForm.downloadUrl} onChange={e => setDeliverableForm({ ...deliverableForm, downloadUrl: e.target.value })} />
              </div>
              <div className="form-group">
                <label className="form-label">Changelog & Notes</label>
                <textarea className="form-textarea" value={deliverableForm.changelog} onChange={e => setDeliverableForm({ ...deliverableForm, changelog: e.target.value })}></textarea>
              </div>
              <button type="submit" className="btn-primary" style={{ marginTop: '8px' }}>Publish Staging Build</button>
            </form>
          </div>
        </div>
      )}

      {/* 3. Assign Task Modal */}
      {modalType === 'CREATE_TASK' && (
        <div className="modal-overlay" onClick={() => setModalType(null)}>
          <div className="modal-content" onClick={e => e.stopPropagation()}>
            <div className="modal-header">
              <h3 className="modal-title">Assign Action Item / Task</h3>
              <button className="btn-icon" onClick={() => setModalType(null)}><span className="icon">close</span></button>
            </div>
            <form onSubmit={handleCreateTask} style={{ display: 'flex', flexDirection: 'column', gap: '14px' }}>
              <div className="form-group">
                <label className="form-label">Project</label>
                <select className="form-select" value={taskForm.projectId} onChange={e => setTaskForm({ ...taskForm, projectId: e.target.value })}>
                  {projects.map(p => <option key={p.id} value={p.id}>{p.title}</option>)}
                </select>
              </div>
              <div className="form-group">
                <label className="form-label">Task Title</label>
                <input required className="form-input" placeholder="e.g. Verify Staging APK Passkey Flow" value={taskForm.title} onChange={e => setTaskForm({ ...taskForm, title: e.target.value })} />
              </div>
              <div className="form-group">
                <label className="form-label">Description</label>
                <textarea className="form-textarea" placeholder="Instructions for client or engineer..." value={taskForm.description} onChange={e => setTaskForm({ ...taskForm, description: e.target.value })}></textarea>
              </div>
              <div className="form-group">
                <label className="form-label">Assigned Role</label>
                <select className="form-select" value={taskForm.assignedToRole} onChange={e => setTaskForm({ ...taskForm, assignedToRole: e.target.value })}>
                  <option value="CLIENT">Client Team</option>
                  <option value="STAFF">Sneksoft Staff</option>
                </select>
              </div>
              <button type="submit" className="btn-primary" style={{ marginTop: '8px' }}>Assign Task</button>
            </form>
          </div>
        </div>
      )}

      {/* 4. Staff Member Modal */}
      {modalType === 'CREATE_STAFF' && (
        <div className="modal-overlay" onClick={() => setModalType(null)}>
          <div className="modal-content" onClick={e => e.stopPropagation()}>
            <div className="modal-header">
              <h3 className="modal-title">Enroll Staff Member</h3>
              <button className="btn-icon" onClick={() => setModalType(null)}><span className="icon">close</span></button>
            </div>
            <form onSubmit={handleCreateStaff} style={{ display: 'flex', flexDirection: 'column', gap: '14px' }}>
              <div className="form-group">
                <label className="form-label">Full Name</label>
                <input required className="form-input" placeholder="e.g. Jordan Lee" value={staffForm.name} onChange={e => setStaffForm({ ...staffForm, name: e.target.value })} />
              </div>
              <div className="form-group">
                <label className="form-label">Corporate Email (@sneksoft.dev or @rizewolf.com)</label>
                <input required type="email" className="form-input" placeholder="e.g. jordan@sneksoft.dev or jordan@rizewolf.com" value={staffForm.email} onChange={e => setStaffForm({ ...staffForm, email: e.target.value })} />
                <div style={{ fontSize: '11px', color: 'var(--text-muted)', marginTop: '4px' }}>
                  Staff detection requires an <strong>@sneksoft.dev</strong> or <strong>@rizewolf.com</strong> address.
                </div>
              </div>
              <div className="form-group">
                <label className="form-label">Role</label>
                <select className="form-select" value={staffForm.role} onChange={e => setStaffForm({ ...staffForm, role: e.target.value })}>
                  <option value="Staff Engineer">Staff Engineer</option>
                  <option value="Staff Lead">Staff Lead</option>
                  <option value="Security Architect">Security Architect</option>
                  <option value="Product Specialist">Product Specialist</option>
                </select>
              </div>
              <button type="submit" className="btn-primary" style={{ marginTop: '8px' }}>Enroll Staff Member</button>
            </form>
          </div>
        </div>
      )}

      {/* 5. Approve Deliverable Modal */}
      {modalType === 'APPROVE_DELIV' && targetDeliverable && (
        <div className="modal-overlay" onClick={() => setModalType(null)}>
          <div className="modal-content" onClick={e => e.stopPropagation()}>
            <div className="modal-header">
              <h3 className="modal-title">Confirm Deliverable Sign-Off</h3>
              <button className="btn-icon" onClick={() => setModalType(null)}><span className="icon">close</span></button>
            </div>
            <p style={{ fontSize: '13px', color: 'var(--text-muted)' }}>
              Are you sure you want to approve <strong>{targetDeliverable.title}</strong>? This marks the build as certified for production release.
            </p>
            <div style={{ display: 'flex', gap: '10px', marginTop: '12px' }}>
              <button className="btn-secondary" style={{ flex: 1 }} onClick={() => setModalType(null)}>Cancel</button>
              <button className="btn-success" style={{ flex: 1 }} onClick={() => handleUpdateDeliverableStatus(targetDeliverable.id, 'APPROVED')}>Confirm Sign-Off</button>
            </div>
          </div>
        </div>
      )}

      {/* 6. Feedback Note Modal */}
      {modalType === 'CHANGES_DELIV' && targetDeliverable && (
        <div className="modal-overlay" onClick={() => setModalType(null)}>
          <div className="modal-content" onClick={e => e.stopPropagation()}>
            <div className="modal-header">
              <h3 className="modal-title">Request Changes / Feedback</h3>
              <button className="btn-icon" onClick={() => setModalType(null)}><span className="icon">close</span></button>
            </div>
            <div className="form-group">
              <label className="form-label">Feedback Notes for Engineering</label>
              <textarea className="form-textarea" placeholder="Describe the requested modifications..." value={approvalNote} onChange={e => setApprovalNote(e.target.value)}></textarea>
            </div>
            <div style={{ display: 'flex', gap: '10px', marginTop: '8px' }}>
              <button className="btn-secondary" style={{ flex: 1 }} onClick={() => setModalType(null)}>Cancel</button>
              <button className="btn-danger" style={{ flex: 1 }} onClick={() => handleUpdateDeliverableStatus(targetDeliverable.id, 'CHANGES_REQUESTED', approvalNote)}>Submit Feedback</button>
            </div>
          </div>
        </div>
      )}

      {/* 7. Assign Staff to Project Modal */}
      {modalType === 'ASSIGN_STAFF' && activeProjectDetail && (
        <div className="modal-overlay" onClick={() => setModalType(null)}>
          <div className="modal-content" onClick={e => e.stopPropagation()}>
            <div className="modal-header">
              <div style={{ display: 'flex', alignItems: 'center', gap: '8px' }}>
                <span className="icon" style={{ color: '#10B981', fontSize: '24px' }}>person_add</span>
                <h3 className="modal-title">Assign Staff to {activeProjectDetail.title}</h3>
              </div>
              <button className="btn-icon" onClick={() => setModalType(null)}><span className="icon">close</span></button>
            </div>
            <p style={{ fontSize: '12px', color: 'var(--text-muted)', marginBottom: '14px' }}>
              Select a team member from the staff roster and assign their project responsibility.
            </p>
            <form
              onSubmit={(e) => {
                e.preventDefault();
                const selected = staff.find(s => String(s.id) === String(assignStaffForm.staffId)) || staff[0];
                handleAssignStaff(activeProjectDetail.id, selected, assignStaffForm.role);
              }}
              style={{ display: 'flex', flexDirection: 'column', gap: '14px' }}
            >
              <div className="form-group">
                <label className="form-label">Select Staff Member</label>
                <select
                  className="form-select"
                  value={assignStaffForm.staffId || staff[0]?.id || ''}
                  onChange={e => setAssignStaffForm({ ...assignStaffForm, staffId: e.target.value })}
                >
                  {staff.map(s => (
                    <option key={s.id} value={s.id}>
                      {s.name} — {s.role} ({s.email})
                    </option>
                  ))}
                </select>
              </div>

              <div className="form-group">
                <label className="form-label">Project Role / Assignment Title</label>
                <input
                  required
                  className="form-input"
                  placeholder="e.g. Lead Android Architect, Security Lead"
                  value={assignStaffForm.role}
                  onChange={e => setAssignStaffForm({ ...assignStaffForm, role: e.target.value })}
                />
              </div>

              <div style={{ display: 'flex', gap: '10px', marginTop: '8px' }}>
                <button type="button" className="btn-secondary" style={{ flex: 1 }} onClick={() => setModalType(null)}>Cancel</button>
                <button type="submit" className="btn-primary" style={{ flex: 1 }}>Confirm Assignment</button>
              </div>
            </form>
          </div>
        </div>
      )}

      {/* 8. Multi-Step Onboard New Client / Customer Modal */}
      {modalType === 'CREATE_CLIENT' && (
        <div className="modal-overlay" onClick={() => { setModalType(null); setClientCreationStep(1); }}>
          <div className="modal-content" style={{ maxWidth: '640px', width: '100%' }} onClick={e => e.stopPropagation()}>
            {/* Modal Header */}
            <div className="modal-header">
              <div style={{ display: 'flex', alignItems: 'center', gap: '8px' }}>
                <span className="icon" style={{ color: '#10B981', fontSize: '24px' }}>business</span>
                <h3 className="modal-title">Onboard Client & Execute Contract</h3>
              </div>
              <button className="btn-icon" onClick={() => { setModalType(null); setClientCreationStep(1); }}><span className="icon">close</span></button>
            </div>

            {/* Multi-Step Wizard Progress Bar */}
            <div style={{ display: 'grid', gridTemplateColumns: 'repeat(4, 1fr)', gap: '8px', marginBottom: '20px' }}>
              {[
                { step: 1, label: '1. Account', icon: 'domain' },
                { step: 2, label: '2. Financials', icon: 'payments' },
                { step: 3, label: '3. Scope', icon: 'folder_special' },
                { step: 4, label: '4. PDF Contract', icon: 'picture_as_pdf' }
              ].map(s => {
                const isCurrent = clientCreationStep === s.step;
                const isPassed = clientCreationStep > s.step;
                return (
                  <div
                    key={s.step}
                    onClick={() => { if (isPassed) setClientCreationStep(s.step); }}
                    style={{
                      padding: '8px 6px',
                      borderRadius: '8px',
                      background: isCurrent ? 'rgba(56, 189, 248, 0.15)' : isPassed ? 'rgba(16, 185, 129, 0.12)' : 'rgba(255,255,255,0.03)',
                      border: isCurrent ? '1px solid var(--primary)' : isPassed ? '1px solid rgba(16, 185, 129, 0.4)' : '1px solid var(--border-subtle)',
                      textAlign: 'center',
                      cursor: isPassed ? 'pointer' : 'default',
                      transition: 'all 0.15s ease'
                    }}
                  >
                    <div style={{ display: 'flex', alignItems: 'center', justifyContent: 'center', gap: '4px', fontSize: '11px', fontWeight: '700', color: isCurrent ? 'var(--primary)' : isPassed ? '#10B981' : 'var(--text-muted)' }}>
                      <span className="icon" style={{ fontSize: '13px' }}>{isPassed ? 'check_circle' : s.icon}</span>
                      <span>{s.label}</span>
                    </div>
                  </div>
                );
              })}
            </div>

            <form onSubmit={(e) => {
              e.preventDefault();
              if (clientCreationStep < 4) {
                if (clientCreationStep === 1 && !clientForm.company.trim()) {
                  showToast('Please enter the corporate account name', 'warning');
                  return;
                }
                setClientCreationStep(prev => prev + 1);
                chimeEngine.playPop();
              } else {
                handleCreateClient(e);
              }
            }}>
              {/* STEP 1: Corporate Profile & Stakeholders */}
              {clientCreationStep === 1 && (
                <div style={{ display: 'flex', flexDirection: 'column', gap: '14px' }}>
                  <div style={{ fontSize: '13px', color: 'var(--text-muted)', marginBottom: '2px' }}>
                    Enter the fundamental corporate identity and primary stakeholder contact information.
                  </div>

                  <div style={{ display: 'grid', gridTemplateColumns: '1fr 1fr', gap: '12px' }}>
                    <div className="form-group">
                      <label className="form-label">Company / Account Name *</label>
                      <input
                        required
                        className="form-input"
                        placeholder="e.g. Apex Global Systems Corp"
                        value={clientForm.company}
                        onChange={e => setClientForm({ ...clientForm, company: e.target.value })}
                        autoFocus
                      />
                    </div>
                    <div className="form-group">
                      <label className="form-label">Primary Stakeholder / Contact Lead *</label>
                      <input
                        required
                        className="form-input"
                        placeholder="e.g. Rachel Vance (VP Engineering)"
                        value={clientForm.primaryContact}
                        onChange={e => setClientForm({ ...clientForm, primaryContact: e.target.value })}
                      />
                    </div>
                  </div>

                  <div style={{ display: 'grid', gridTemplateColumns: '1fr 1fr', gap: '12px' }}>
                    <div className="form-group">
                      <label className="form-label">Corporate Email Address *</label>
                      <input
                        required
                        type="email"
                        className="form-input"
                        placeholder="e.g. rachel.vance@apexglobal.io"
                        value={clientForm.email}
                        onChange={e => setClientForm({ ...clientForm, email: e.target.value })}
                      />
                    </div>
                    <div className="form-group">
                      <label className="form-label">Phone Number</label>
                      <input
                        className="form-input"
                        placeholder="e.g. +1 (555) 349-2900"
                        value={clientForm.phone}
                        onChange={e => setClientForm({ ...clientForm, phone: e.target.value })}
                      />
                    </div>
                  </div>

                  <div className="form-group">
                    <label className="form-label">Industry / Sector Vertical</label>
                    <input
                      className="form-input"
                      placeholder="e.g. Enterprise Cloud & Cyber Security, FinTech, HealthTech"
                      value={clientForm.industry}
                      onChange={e => setClientForm({ ...clientForm, industry: e.target.value })}
                    />
                  </div>

                  <div style={{ display: 'flex', justifyContent: 'flex-end', gap: '10px', marginTop: '10px' }}>
                    <button type="button" className="btn-secondary" onClick={() => setModalType(null)}>Cancel</button>
                    <button type="submit" className="btn-primary">
                      <span>Next: Financial Terms</span>
                      <span className="icon">arrow_forward</span>
                    </button>
                  </div>
                </div>
              )}

              {/* STEP 2: Retainer, Billing & SLA Tier */}
              {clientCreationStep === 2 && (
                <div style={{ display: 'flex', flexDirection: 'column', gap: '14px' }}>
                  <div style={{ fontSize: '13px', color: 'var(--text-muted)', marginBottom: '2px' }}>
                    Configure the commercial retainers, billing milestones, and Service Level Agreement (SLA) commitment.
                  </div>

                  <div style={{ display: 'grid', gridTemplateColumns: '1fr 1fr 1fr', gap: '12px' }}>
                    <div className="form-group">
                      <label className="form-label">Account Tier</label>
                      <select
                        className="form-select"
                        value={clientForm.tier}
                        onChange={e => setClientForm({ ...clientForm, tier: e.target.value })}
                      >
                        <option value="ENTERPRISE">Enterprise Tier</option>
                        <option value="STRATEGIC">Strategic Partner</option>
                        <option value="GROWTH">Growth Tier</option>
                        <option value="STARTUP">Startup Acceleration</option>
                      </select>
                    </div>

                    <div className="form-group">
                      <label className="form-label">Monthly Retainer ($)</label>
                      <input
                        className="form-input"
                        placeholder="e.g. 18,500"
                        value={clientForm.monthlyRetainer}
                        onChange={e => setClientForm({ ...clientForm, monthlyRetainer: e.target.value })}
                      />
                    </div>

                    <div className="form-group">
                      <label className="form-label">Billing Status</label>
                      <select
                        className="form-select"
                        value={clientForm.billingStatus}
                        onChange={e => setClientForm({ ...clientForm, billingStatus: e.target.value })}
                      >
                        <option value="CURRENT">CURRENT</option>
                        <option value="PAID_AHEAD">PAID AHEAD</option>
                        <option value="INVOICED">INVOICED</option>
                      </select>
                    </div>
                  </div>

                  <div style={{ display: 'grid', gridTemplateColumns: '1fr 1fr', gap: '12px' }}>
                    <div className="form-group">
                      <label className="form-label">Contract Effective Start Date</label>
                      <input
                        type="date"
                        className="form-input"
                        value={clientForm.contractStart}
                        onChange={e => setClientForm({ ...clientForm, contractStart: e.target.value })}
                      />
                    </div>
                    <div className="form-group">
                      <label className="form-label">Contract Term End Date</label>
                      <input
                        type="date"
                        className="form-input"
                        value={clientForm.contractEnd}
                        onChange={e => setClientForm({ ...clientForm, contractEnd: e.target.value })}
                      />
                    </div>
                  </div>

                  <div className="form-group">
                    <label className="form-label">Service Level Agreement (SLA) Commitment</label>
                    <select
                      className="form-select"
                      value={clientForm.slaTier}
                      onChange={e => setClientForm({ ...clientForm, slaTier: e.target.value })}
                    >
                      <option value="24/7 Dedicated Architecture Team (1hr SLA)">24/7 Dedicated Architecture Team (1hr SLA Guarantee)</option>
                      <option value="Priority Enterprise Support (4hr SLA)">Priority Enterprise Support (4hr SLA Response)</option>
                      <option value="Standard Business Engineering (8hr SLA)">Standard Business Engineering (8hr SLA)</option>
                    </select>
                  </div>

                  <div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', marginTop: '10px' }}>
                    <button type="button" className="btn-secondary" onClick={() => setClientCreationStep(1)}>
                      <span className="icon">arrow_back</span>
                      <span>Back</span>
                    </button>
                    <button type="submit" className="btn-primary">
                      <span>Next: Engineering Scope</span>
                      <span className="icon">arrow_forward</span>
                    </button>
                  </div>
                </div>
              )}

              {/* STEP 3: Project Association & Scope Brief */}
              {clientCreationStep === 3 && (
                <div style={{ display: 'flex', flexDirection: 'column', gap: '14px' }}>
                  <div style={{ fontSize: '13px', color: 'var(--text-muted)', marginBottom: '2px' }}>
                    Associate existing engineering projects with this client and define compliance terms.
                  </div>

                  <div className="form-group">
                    <label className="form-label">Link Active Engineering Projects</label>
                    <div style={{ display: 'grid', gridTemplateColumns: '1fr 1fr', gap: '8px', maxHeight: '150px', overflowY: 'auto', padding: '6px', background: 'rgba(0,0,0,0.2)', borderRadius: '8px', border: '1px solid var(--border-subtle)' }}>
                      {projects.map(p => {
                        const isSelected = (clientForm.assignedProjects || []).includes(String(p.id)) || (clientForm.assignedProjects || []).includes(p.title);
                        return (
                          <div
                            key={p.id}
                            onClick={() => {
                              const current = clientForm.assignedProjects || [];
                              const updated = isSelected
                                ? current.filter(id => id !== String(p.id) && id !== p.title)
                                : [...current, String(p.id)];
                              setClientForm({ ...clientForm, assignedProjects: updated });
                            }}
                            style={{
                              padding: '8px 10px',
                              borderRadius: '6px',
                              background: isSelected ? 'rgba(56, 189, 248, 0.15)' : 'rgba(255,255,255,0.03)',
                              border: isSelected ? '1px solid var(--primary)' : '1px solid var(--border-subtle)',
                              cursor: 'pointer',
                              display: 'flex',
                              alignItems: 'center',
                              justifyContent: 'space-between',
                              fontSize: '12px'
                            }}
                          >
                            <span style={{ fontWeight: isSelected ? '700' : '400', color: isSelected ? 'var(--primary)' : 'var(--text-main)' }}>{p.title}</span>
                            <span className="icon" style={{ fontSize: '16px', color: isSelected ? 'var(--primary)' : 'var(--text-muted)' }}>
                              {isSelected ? 'check_box' : 'check_box_outline_blank'}
                            </span>
                          </div>
                        );
                      })}
                    </div>
                  </div>

                  <div className="form-group">
                    <label className="form-label">Technical Objectives & Deliverables Scope</label>
                    <textarea
                      className="form-textarea"
                      placeholder="Outline key deliverables, architectural goals, target milestone deadlines..."
                      value={clientForm.notes}
                      onChange={e => setClientForm({ ...clientForm, notes: e.target.value })}
                      style={{ minHeight: '70px' }}
                    ></textarea>
                  </div>

                  <div style={{ display: 'flex', flexDirection: 'column', gap: '8px', padding: '10px', background: 'rgba(16, 185, 129, 0.05)', borderRadius: '8px', border: '1px solid rgba(16, 185, 129, 0.2)' }}>
                    <div style={{ display: 'flex', alignItems: 'center', gap: '8px', fontSize: '12px', color: '#10B981', fontWeight: '700' }}>
                      <span className="icon" style={{ fontSize: '16px' }}>verified_user</span>
                      <span>Legal Compliance & Mutual Confidentiality</span>
                    </div>
                    <label style={{ display: 'flex', alignItems: 'center', gap: '8px', fontSize: '12px', color: 'var(--text-muted)', cursor: 'pointer' }}>
                      <input
                        type="checkbox"
                        checked={clientForm.ndaSigned}
                        onChange={e => setClientForm({ ...clientForm, ndaSigned: e.target.checked })}
                      />
                      <span>Mutual Non-Disclosure Agreement (NDA) & SOC-2 compliance executed</span>
                    </label>
                  </div>

                  <div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', marginTop: '10px' }}>
                    <button type="button" className="btn-secondary" onClick={() => setClientCreationStep(2)}>
                      <span className="icon">arrow_back</span>
                      <span>Back</span>
                    </button>
                    <button type="submit" className="btn-primary">
                      <span>Next: PDF Contract Upload</span>
                      <span className="icon">arrow_forward</span>
                    </button>
                  </div>
                </div>
              )}

              {/* STEP 4: PDF Contract Upload & Execution Sign-Off */}
              {clientCreationStep === 4 && (
                <div style={{ display: 'flex', flexDirection: 'column', gap: '14px' }}>
                  <div style={{ fontSize: '13px', color: 'var(--text-muted)', marginBottom: '2px' }}>
                    Upload the signed Master Services Agreement (MSA) or generate a verified Enterprise contract document.
                  </div>

                  {/* Drag & Drop PDF Dropzone */}
                  <div
                    onDragOver={(e) => { e.preventDefault(); setIsDraggingPdf(true); }}
                    onDragLeave={() => setIsDraggingPdf(false)}
                    onDrop={(e) => { e.preventDefault(); setIsDraggingPdf(false); handlePdfUpload(e); }}
                    style={{
                      border: isDraggingPdf ? '2px dashed var(--primary)' : '2px dashed rgba(239, 68, 68, 0.4)',
                      background: isDraggingPdf ? 'rgba(56, 189, 248, 0.1)' : 'rgba(239, 68, 68, 0.04)',
                      borderRadius: '12px',
                      padding: '24px 16px',
                      textAlign: 'center',
                      cursor: 'pointer',
                      transition: 'all 0.2s ease'
                    }}
                    onClick={() => document.getElementById('contract-pdf-input')?.click()}
                  >
                    <input
                      id="contract-pdf-input"
                      type="file"
                      accept=".pdf,application/pdf"
                      style={{ display: 'none' }}
                      onChange={handlePdfUpload}
                    />
                    <div style={{ width: '48px', height: '48px', borderRadius: '50%', background: 'rgba(239, 68, 68, 0.15)', color: '#EF4444', display: 'flex', alignItems: 'center', justifyContent: 'center', margin: '0 auto 10px' }}>
                      <span className="icon" style={{ fontSize: '28px' }}>upload_file</span>
                    </div>
                    <div style={{ fontSize: '14px', fontWeight: '700', color: 'var(--text-main)' }}>
                      Drag & Drop Contract PDF Here
                    </div>
                    <div style={{ fontSize: '12px', color: 'var(--text-muted)', marginTop: '4px' }}>
                      Or click to browse files (*.pdf)
                    </div>
                  </div>

                  {/* Quick Action Button for Standard MSA */}
                  <div style={{ display: 'flex', justifyContent: 'center' }}>
                    <button
                      type="button"
                      className="btn-secondary"
                      style={{ fontSize: '11px', padding: '6px 12px', display: 'flex', alignItems: 'center', gap: '6px' }}
                      onClick={() => {
                        const name = `${(clientForm.company || 'Enterprise').replace(/\s+/g, '_')}_Master_Services_Agreement_2026.pdf`;
                        setClientForm(prev => ({
                          ...prev,
                          contractPdfName: name,
                          contractPdfSize: '2.8 MB'
                        }));
                        setContractPdfFile({
                          name,
                          size: '2.8 MB',
                          uploadedAt: new Date().toLocaleTimeString()
                        });
                        chimeEngine.playSuccess();
                        showToast('Standard Enterprise MSA contract generated and attached!', 'success');
                      }}
                    >
                      <span className="icon" style={{ fontSize: '14px', color: '#10B981' }}>auto_awesome</span>
                      <span>Generate & Attach Standard Sneksoft MSA Contract</span>
                    </button>
                  </div>

                  {/* Attached Contract Preview Card */}
                  <div style={{ padding: '12px 14px', background: 'var(--bg-card)', borderRadius: '10px', border: '1px solid var(--border-subtle)', display: 'flex', alignItems: 'center', justifyContent: 'space-between' }}>
                    <div style={{ display: 'flex', alignItems: 'center', gap: '12px', minWidth: 0 }}>
                      <span className="icon" style={{ color: '#EF4444', fontSize: '32px' }}>picture_as_pdf</span>
                      <div style={{ minWidth: 0 }}>
                        <div style={{ fontSize: '13px', fontWeight: '800', color: 'var(--text-main)', textOverflow: 'ellipsis', overflow: 'hidden', whiteSpace: 'nowrap' }}>
                          {clientForm.contractPdfName || 'Enterprise_Master_Services_Agreement_2026.pdf'}
                        </div>
                        <div style={{ fontSize: '11px', color: '#10B981', display: 'flex', alignItems: 'center', gap: '4px', marginTop: '2px' }}>
                          <span className="icon" style={{ fontSize: '13px' }}>verified</span>
                          <span>SHA-256 Verified • {clientForm.contractPdfSize || '2.4 MB'}</span>
                        </div>
                      </div>
                    </div>

                    <span className="status-badge" style={{ background: 'rgba(16, 185, 129, 0.15)', color: '#10B981' }}>
                      Ready to Execute
                    </span>
                  </div>

                  {/* Onboarding Summary Snapshot */}
                  <div style={{ padding: '10px 12px', background: 'rgba(255,255,255,0.02)', borderRadius: '8px', border: '1px solid var(--border-subtle)', fontSize: '12px', display: 'grid', gridTemplateColumns: '1fr 1fr', gap: '6px' }}>
                    <div><span style={{ color: 'var(--text-muted)' }}>Account:</span> <span style={{ fontWeight: '700' }}>{clientForm.company || 'Pending'}</span></div>
                    <div><span style={{ color: 'var(--text-muted)' }}>Lead:</span> <span style={{ fontWeight: '700' }}>{clientForm.primaryContact || 'Pending'}</span></div>
                    <div><span style={{ color: 'var(--text-muted)' }}>Retainer:</span> <span style={{ fontWeight: '700', color: '#10B981' }}>${clientForm.monthlyRetainer || '0'}/mo</span></div>
                    <div><span style={{ color: 'var(--text-muted)' }}>Tier:</span> <span style={{ fontWeight: '700', color: 'var(--primary)' }}>{clientForm.tier}</span></div>
                  </div>

                  <div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', marginTop: '10px' }}>
                    <button type="button" className="btn-secondary" onClick={() => setClientCreationStep(3)}>
                      <span className="icon">arrow_back</span>
                      <span>Back</span>
                    </button>
                    <button type="submit" className="btn-primary" style={{ background: '#10B981', borderColor: '#10B981' }}>
                      <span className="icon">verified</span>
                      <span>Execute Contract & Onboard Client</span>
                    </button>
                  </div>
                </div>
              )}
            </form>
          </div>
        </div>
      )}

      {/* 8.5 Executed Contract PDF Viewer Modal */}
      {viewingContractClient && (
        <div className="modal-overlay" onClick={() => setViewingContractClient(null)}>
          <div className="modal-content" style={{ maxWidth: '680px', width: '100%' }} onClick={e => e.stopPropagation()}>
            <div className="modal-header">
              <div style={{ display: 'flex', alignItems: 'center', gap: '8px' }}>
                <span className="icon" style={{ color: '#EF4444', fontSize: '26px' }}>picture_as_pdf</span>
                <div>
                  <h3 className="modal-title">Master Services Agreement (MSA)</h3>
                  <div style={{ fontSize: '11px', color: 'var(--text-muted)' }}>{viewingContractClient.company} • Document ID: SNEK-MSA-{viewingContractClient.id}</div>
                </div>
              </div>
              <button className="btn-icon" onClick={() => setViewingContractClient(null)}><span className="icon">close</span></button>
            </div>

            {/* Rendered Contract Document Preview Box */}
            <div style={{ background: '#FFFFFF', color: '#0F172A', padding: '24px', borderRadius: '10px', maxHeight: '420px', overflowY: 'auto', fontFamily: 'monospace', fontSize: '12px', lineHeight: '1.6', border: '1px solid #CBD5E1', boxShadow: '0 4px 20px rgba(0,0,0,0.25)' }}>
              <div style={{ borderBottom: '2px solid #0F172A', paddingBottom: '12px', marginBottom: '16px', display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}>
                <div>
                  <div style={{ fontSize: '16px', fontWeight: '900', letterSpacing: '-0.02em', color: '#0F172A' }}>SNEKSOFT TECHNOLOGIES INC.</div>
                  <div style={{ fontSize: '11px', color: '#64748B' }}>ENTERPRISE SERVICES & SOFTWARE DEVELOPMENT CONTRACT</div>
                </div>
                <div style={{ textAlign: 'right' }}>
                  <div style={{ background: '#DCFCE7', color: '#166534', padding: '3px 8px', borderRadius: '4px', fontWeight: '800', fontSize: '10px', display: 'inline-block' }}>EXECUTED & VERIFIED</div>
                </div>
              </div>

              <div style={{ marginBottom: '16px' }}>
                <div style={{ fontWeight: '700', textTransform: 'uppercase', color: '#475569', marginBottom: '4px' }}>1. PARTIES & ENGAGEMENT</div>
                <div>This agreement is entered into between <strong>Sneksoft Technologies</strong> ("Service Provider") and <strong>{viewingContractClient.company}</strong> ("Client"), represented by <strong>{viewingContractClient.primaryContact}</strong> ({viewingContractClient.email}).</div>
              </div>

              <div style={{ marginBottom: '16px' }}>
                <div style={{ fontWeight: '700', textTransform: 'uppercase', color: '#475569', marginBottom: '4px' }}>2. COMMERCIAL RETAINER & TERM</div>
                <div>• Account Classification: <strong>{viewingContractClient.tier || 'ENTERPRISE'} TIER</strong></div>
                <div>• Monthly Retainer Fee: <strong>${viewingContractClient.monthlyRetainer || '18,500'}/month</strong></div>
                <div>• Effective Duration: <strong>{viewingContractClient.contractStart || '2026-01-01'} to {viewingContractClient.contractEnd || '2026-12-31'}</strong></div>
                <div>• Billing Status: <strong>{viewingContractClient.billingStatus || 'CURRENT'}</strong></div>
              </div>

              <div style={{ marginBottom: '16px' }}>
                <div style={{ fontWeight: '700', textTransform: 'uppercase', color: '#475569', marginBottom: '4px' }}>3. SERVICE LEVEL AGREEMENT (SLA)</div>
                <div>The Service Provider commits to: <strong>{viewingContractClient.slaTier || '24/7 Dedicated Architecture Team (1hr SLA)'}</strong> for all production and critical issues.</div>
              </div>

              <div style={{ marginBottom: '16px' }}>
                <div style={{ fontWeight: '700', textTransform: 'uppercase', color: '#475569', marginBottom: '4px' }}>4. CONFIDENTIALITY & IP OWNERSHIP</div>
                <div>All custom engineering source code, deliverables, and architecture artifacts developed under this engagement belong entirely to the Client upon milestone settlement. Mutual NDA terms strictly active.</div>
              </div>

              <div style={{ borderTop: '1px dashed #94A3B8', paddingTop: '14px', marginTop: '20px', display: 'grid', gridTemplateColumns: '1fr 1fr', gap: '16px' }}>
                <div>
                  <div style={{ fontSize: '11px', color: '#64748B' }}>Authorized Sneksoft Signatory:</div>
                  <div style={{ fontFamily: 'cursive', fontSize: '16px', color: '#1E40AF', marginTop: '4px' }}>Alex Chen</div>
                  <div style={{ fontSize: '10px', color: '#94A3B8' }}>Staff Architect • Signed via Passkey Biometrics</div>
                </div>
                <div>
                  <div style={{ fontSize: '11px', color: '#64748B' }}>Authorized Client Officer:</div>
                  <div style={{ fontFamily: 'cursive', fontSize: '16px', color: '#1E40AF', marginTop: '4px' }}>{viewingContractClient.primaryContact}</div>
                  <div style={{ fontSize: '10px', color: '#94A3B8' }}>Corporate Lead • Signed & Executed</div>
                </div>
              </div>
            </div>

            <div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', marginTop: '16px' }}>
              <button type="button" className="btn-secondary" onClick={() => setViewingContractClient(null)}>Close</button>
              <button
                type="button"
                className="btn-primary"
                onClick={() => handleDownloadContractPdf(viewingContractClient)}
              >
                <span className="icon">download</span>
                <span>Download Executed PDF</span>
              </button>
            </div>
          </div>
        </div>
      )}

      {/* 9. Edit Client Modal */}
      {modalType === 'EDIT_CLIENT' && editingClient && (
        <div className="modal-overlay" onClick={() => setModalType(null)}>
          <div className="modal-content" onClick={e => e.stopPropagation()}>
            <div className="modal-header">
              <div style={{ display: 'flex', alignItems: 'center', gap: '8px' }}>
                <span className="icon" style={{ color: '#38BDF8', fontSize: '24px' }}>edit</span>
                <h3 className="modal-title">Edit Client: {editingClient.company}</h3>
              </div>
              <button className="btn-icon" onClick={() => setModalType(null)}><span className="icon">close</span></button>
            </div>
            <form onSubmit={handleUpdateClient} style={{ display: 'flex', flexDirection: 'column', gap: '14px' }}>
              <div style={{ display: 'grid', gridTemplateColumns: '1fr 1fr', gap: '12px' }}>
                <div className="form-group">
                  <label className="form-label">Company Name *</label>
                  <input
                    required
                    className="form-input"
                    value={clientForm.company}
                    onChange={e => setClientForm({ ...clientForm, company: e.target.value })}
                  />
                </div>
                <div className="form-group">
                  <label className="form-label">Primary Contact *</label>
                  <input
                    required
                    className="form-input"
                    value={clientForm.primaryContact}
                    onChange={e => setClientForm({ ...clientForm, primaryContact: e.target.value })}
                  />
                </div>
              </div>

              <div style={{ display: 'grid', gridTemplateColumns: '1fr 1fr', gap: '12px' }}>
                <div className="form-group">
                  <label className="form-label">Email Address *</label>
                  <input
                    required
                    type="email"
                    className="form-input"
                    value={clientForm.email}
                    onChange={e => setClientForm({ ...clientForm, email: e.target.value })}
                  />
                </div>
                <div className="form-group">
                  <label className="form-label">Phone Number</label>
                  <input
                    className="form-input"
                    value={clientForm.phone}
                    onChange={e => setClientForm({ ...clientForm, phone: e.target.value })}
                  />
                </div>
              </div>

              <div style={{ display: 'grid', gridTemplateColumns: '1fr 1fr 1fr', gap: '12px' }}>
                <div className="form-group">
                  <label className="form-label">Account Tier</label>
                  <select
                    className="form-select"
                    value={clientForm.tier}
                    onChange={e => setClientForm({ ...clientForm, tier: e.target.value })}
                  >
                    <option value="ENTERPRISE">Enterprise</option>
                    <option value="STRATEGIC">Strategic</option>
                    <option value="GROWTH">Growth</option>
                    <option value="STARTUP">Startup</option>
                  </select>
                </div>

                <div className="form-group">
                  <label className="form-label">Status</label>
                  <select
                    className="form-select"
                    value={clientForm.status}
                    onChange={e => setClientForm({ ...clientForm, status: e.target.value })}
                  >
                    <option value="ACTIVE">Active</option>
                    <option value="ONBOARDING">Onboarding</option>
                  </select>
                </div>

                <div className="form-group">
                  <label className="form-label">Monthly Retainer ($)</label>
                  <input
                    className="form-input"
                    value={clientForm.monthlyRetainer}
                    onChange={e => setClientForm({ ...clientForm, monthlyRetainer: e.target.value })}
                  />
                </div>
              </div>

              <div style={{ display: 'grid', gridTemplateColumns: '1fr 1fr', gap: '12px' }}>
                <div className="form-group">
                  <label className="form-label">Industry / Sector</label>
                  <input
                    className="form-input"
                    value={clientForm.industry}
                    onChange={e => setClientForm({ ...clientForm, industry: e.target.value })}
                  />
                </div>
                <div className="form-group">
                  <label className="form-label">Billing Status</label>
                  <select
                    className="form-select"
                    value={clientForm.billingStatus}
                    onChange={e => setClientForm({ ...clientForm, billingStatus: e.target.value })}
                  >
                    <option value="CURRENT">CURRENT</option>
                    <option value="PAID_AHEAD">PAID AHEAD</option>
                    <option value="INVOICED">INVOICED</option>
                  </select>
                </div>
              </div>

              <div className="form-group">
                <label className="form-label">Account Notes</label>
                <textarea
                  className="form-textarea"
                  value={clientForm.notes}
                  onChange={e => setClientForm({ ...clientForm, notes: e.target.value })}
                ></textarea>
              </div>

              <div style={{ display: 'flex', gap: '10px', marginTop: '6px' }}>
                <button type="button" className="btn-secondary" style={{ flex: 1 }} onClick={() => setModalType(null)}>Cancel</button>
                <button type="submit" className="btn-primary" style={{ flex: 1 }}>Save Changes</button>
              </div>
            </form>
          </div>
        </div>
      )}

      {/* 10. Assign Client to Projects Modal */}
      {modalType === 'ASSIGN_CLIENT_PROJECT' && editingClient && (
        <div className="modal-overlay" onClick={() => setModalType(null)}>
          <div className="modal-content" onClick={e => e.stopPropagation()}>
            <div className="modal-header">
              <div style={{ display: 'flex', alignItems: 'center', gap: '8px' }}>
                <span className="icon" style={{ color: '#10B981', fontSize: '24px' }}>folder_shared</span>
                <h3 className="modal-title">Link Projects for {editingClient.company}</h3>
              </div>
              <button className="btn-icon" onClick={() => setModalType(null)}><span className="icon">close</span></button>
            </div>
            <p style={{ fontSize: '13px', color: 'var(--text-muted)', marginBottom: '14px' }}>
              Toggle which engineering projects are associated with this client account:
            </p>

            <div style={{ display: 'flex', flexDirection: 'column', gap: '10px', maxHeight: '320px', overflowY: 'auto', marginBottom: '16px' }}>
              {projects.map(p => {
                const isAssigned = (editingClient.assignedProjects || []).includes(String(p.id));
                return (
                  <div
                    key={p.id}
                    onClick={() => {
                      handleAssignClientProject(editingClient.id, p.id);
                      setEditingClient(prev => {
                        if (!prev) return prev;
                        const current = prev.assignedProjects || [];
                        const updated = current.includes(String(p.id))
                          ? current.filter(id => id !== String(p.id))
                          : [...current, String(p.id)];
                        return { ...prev, assignedProjects: updated };
                      });
                    }}
                    style={{
                      display: 'flex',
                      justifyContent: 'space-between',
                      alignItems: 'center',
                      padding: '12px 14px',
                      background: isAssigned ? 'rgba(16, 185, 129, 0.12)' : 'var(--bg-card-secondary)',
                      borderRadius: '10px',
                      border: isAssigned ? '1px solid #10B981' : '1px solid var(--border-subtle)',
                      cursor: 'pointer',
                      transition: 'all 0.15s ease'
                    }}
                  >
                    <div>
                      <div style={{ fontWeight: '700', fontSize: '13px', color: isAssigned ? '#10B981' : 'var(--text-main)' }}>{p.title}</div>
                      <div style={{ fontSize: '11px', color: 'var(--text-muted)' }}>Category: {p.category} • Progress: {p.progress}%</div>
                    </div>
                    <span className="icon" style={{ color: isAssigned ? '#10B981' : 'var(--text-muted)', fontSize: '22px' }}>
                      {isAssigned ? 'check_box' : 'check_box_outline_blank'}
                    </span>
                  </div>
                );
              })}
            </div>

            <button type="button" className="btn-primary" style={{ width: '100%' }} onClick={() => setModalType(null)}>
              Done Linking Projects
            </button>
          </div>
        </div>
      )}
    </div>
  );
}

const root = ReactDOM.createRoot(document.getElementById('root'));
root.render(<App />);
