// Table grid data + status palette

// Statuses — bold colors, high contrast for fast reading
const TABLE_STATUS = {
  free:        { label: 'Free',          bg: '#e9ebee',  fg: '#3a3f45',  pillBg: '#d3d6db', pillFg: '#3a3f45' },
  open:        { label: 'Open',          bg: '#f5b740',  fg: '#3a2a05',  pillBg: '#3a2a05', pillFg: '#ffe7b2' },
  partial:     { label: 'Partial',       bg: '#3b86e6',  fg: '#ffffff',  pillBg: 'rgba(0,0,0,0.25)', pillFg: '#ffffff' },
  paid:        { label: 'Paid',          bg: '#3aa961',  fg: '#ffffff',  pillBg: 'rgba(0,0,0,0.25)', pillFg: '#ffffff' },
  reserved:    { label: 'Reserved',      bg: '#8b5cd6',  fg: '#ffffff',  pillBg: 'rgba(0,0,0,0.25)', pillFg: '#ffffff' },
  attention:   { label: 'Needs you',     bg: '#e64545',  fg: '#ffffff',  pillBg: 'rgba(0,0,0,0.3)',  pillFg: '#ffffff' },
  mine:        { label: 'Mine',          bg: '#1f1f24',  fg: '#ffffff',  pillBg: '#f5b740', pillFg: '#3a2a05' },
};

// Badge dictionary — icon + tone for each flag
const TABLE_BADGES = {
  cleaning: { label: 'Cleaning',  icon: '🧹', tone: '#8a6d2b' },
  waiter:   { label: 'Waiter',    icon: '🔔', tone: '#d94b26' },
  vip:      { label: 'VIP',       icon: '⭐', tone: '#a76b00' },
  allergy:  { label: 'Allergy',   icon: '⚠',  tone: '#a5361b' },
  birthday: { label: 'Birthday',  icon: '🎂', tone: '#a8276b' },
};

// 24 demo tables across statuses + sections
const TABLES = [
  { name: 'A-1',  section: 'Terrace',   status: 'open',      amount: 84.50,  waiters: ['Marco Riva'],   badges: [] },
  { name: 'A-2',  section: 'Terrace',   status: 'mine',      amount: 127.20, waiters: ['You'],          badges: ['vip'] },
  { name: 'A-3',  section: 'Terrace',   status: 'free',      amount: 0,      waiters: [],               badges: [] },
  { name: 'A-4',  section: 'Terrace',   status: 'attention', amount: 56.00,  waiters: ['Luca'],         badges: ['waiter'] },
  { name: 'A-5',  section: 'Terrace',   status: 'reserved',  amount: 0,      waiters: ['Elena'],        badges: ['birthday'] },
  { name: 'A-6',  section: 'Terrace',   status: 'paid',      amount: 0,      waiters: ['Marco Riva'],   badges: [] },

  { name: 'B-1',  section: 'Hall',      status: 'partial',   amount: 38.00,  waiters: ['Sofia'],        badges: [] },
  { name: 'B-2',  section: 'Hall',      status: 'open',      amount: 212.80, waiters: ['Marco', 'Sofia', 'Luca', 'Elena'], badges: ['vip', 'allergy', 'birthday', 'waiter'] },
  { name: 'B-3',  section: 'Hall',      status: 'free',      amount: 0,      waiters: [],               badges: ['cleaning'] },
  { name: 'B-4',  section: 'Hall',      status: 'mine',      amount: 16.30,  waiters: ['You', 'Billy'], badges: [] },
  { name: 'B-5',  section: 'Hall',      status: 'open',      amount: 72.80,  waiters: ['Sofia'],        badges: ['allergy'] },
  { name: 'B-6',  section: 'Hall',      status: 'free',      amount: 0,      waiters: [],               badges: [] },

  { name: 'C-1',  section: 'Bar',       status: 'partial',   amount: 24.50,  waiters: ['Elena'],        badges: [] },
  { name: 'C-2',  section: 'Bar',       status: 'free',      amount: 0,      waiters: [],               badges: [] },
  { name: 'C-3',  section: 'Bar',       status: 'paid',      amount: 0,      waiters: ['Luca'],         badges: [] },
  { name: 'C-4',  section: 'Bar',       status: 'reserved',  amount: 0,      waiters: ['Sofia'],        badges: [] },
];

window.TABLE_STATUS = TABLE_STATUS;
window.TABLE_BADGES = TABLE_BADGES;
window.TABLES = TABLES;
