@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@600;700&family=Nunito:wght@400;500;600;700;800&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:      #f4f6f9;
  --panel:   #ffffff;
  --border:  #e2e8f0;
  --border2: #cbd5e1;
  --text:    #1a202c;
  --text2:   #4a5568;
  --muted:   #94a3b8;
  --accent:  #2c3e50;
  --accent2: #34495e;
  --success: #27ae60;
  --warning: #e67e22;
  --danger:  #e53e3e;
  --info:    #3182ce;
  --radius:  14px;
  --radius-sm: 9px;
  --shadow:  0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.1);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Nunito', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── HEADER ── */
.w-header {
  background: var(--accent);
  padding: 14px 16px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 100;
  box-shadow: var(--shadow-md);
}

.w-header-left { display: flex; align-items: center; gap: 10px; }

.w-header h1 {
  font-family: 'Playfair Display', serif;
  font-size: 20px; font-weight: 700; color: #fff;
}

.w-hint {
  font-size: 12px; color: rgba(255,255,255,0.65);
  font-weight: 600; padding-left: 2px;
}

.w-refresh-btn {
  width: 38px; height: 38px;
  background: rgba(255,255,255,0.15);
  border: 1.5px solid rgba(255,255,255,0.25);
  border-radius: 10px; color: #fff;
  font-size: 16px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s;
}
.w-refresh-btn:hover { background: rgba(255,255,255,0.25); }

/* ── TABS ── */
.w-tabs {
  display: flex; gap: 4px;
  padding: 10px 16px 0;
  background: var(--accent);
}

.w-tab {
  flex: 1; padding: 9px 6px;
  border: none; border-radius: 10px 10px 0 0;
  background: rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.7);
  font-family: 'Nunito', sans-serif;
  font-size: 12px; font-weight: 700;
  cursor: pointer; transition: all 0.2s;
  display: flex; align-items: center; justify-content: center; gap: 5px;
}

.w-tab.active {
  background: var(--bg);
  color: var(--text);
}

.w-tab-badge {
  background: var(--danger);
  color: #fff; font-size: 10px; font-weight: 800;
  padding: 1px 6px; border-radius: 100px;
  min-width: 18px; text-align: center;
}

/* ── PANEL ── */
.w-panel { padding: 14px 16px 80px; }

/* ── NEW ORDER CARD ── */
.new-order-card {
  background: var(--panel);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 14px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.new-order-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 16px;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s;
}
.new-order-header:hover { background: #f8fafc; }

.new-order-title { font-size: 14px; font-weight: 800; color: var(--accent); }
.new-order-arrow  { font-size: 11px; color: var(--muted); transition: transform 0.2s; }
.new-order-arrow.open { transform: rotate(180deg); }

.new-order-body {
  padding: 0 16px 14px;
  border-top: 1px solid var(--border);
  display: none;
}
.new-order-body.open { display: block; }

.form-row { margin-bottom: 10px; }
.form-label { font-size: 11px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: 0.6px; margin-bottom: 5px; display: block; margin-top: 12px; }

.form-select, .form-input {
  width: 100%; padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: #f8fafc;
  font-family: 'Nunito', sans-serif;
  font-size: 14px; font-weight: 500; color: var(--text);
  outline: none; transition: border-color 0.2s;
}
.form-select:focus, .form-input:focus { border-color: var(--accent); background: #fff; }

/* Item rows */
.item-row {
  display: flex; gap: 6px; align-items: center;
  margin-bottom: 6px;
}

.item-select {
  flex: 1; padding: 9px 10px;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  background: #f8fafc; font-family: 'Nunito', sans-serif;
  font-size: 13px; color: var(--text); outline: none;
  transition: border-color 0.2s;
}
.item-select:focus { border-color: var(--accent); background: #fff; }

.item-qty {
  width: 58px; padding: 9px 8px;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  background: #f8fafc; font-family: 'Nunito', sans-serif;
  font-size: 13px; font-weight: 700; color: var(--text);
  text-align: center; outline: none;
  transition: border-color 0.2s;
}
.item-qty:focus { border-color: var(--accent); background: #fff; }

.item-remove-btn {
  width: 32px; height: 32px; border-radius: 8px;
  background: #fff5f5; border: 1.5px solid #fed7d7;
  color: var(--danger); font-size: 12px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: all 0.15s;
}
.item-remove-btn:hover { background: #fed7d7; }

.add-item-btn {
  background: none; border: 1.5px dashed var(--border2);
  border-radius: var(--radius-sm); padding: 7px 14px;
  font-family: 'Nunito', sans-serif; font-size: 12px; font-weight: 700;
  color: var(--accent2); cursor: pointer; width: 100%;
  transition: all 0.15s; margin-top: 4px;
}
.add-item-btn:hover { border-color: var(--accent); color: var(--accent); background: #f8fafc; }

.place-order-btn {
  width: 100%; padding: 12px;
  background: var(--accent); color: #fff;
  border: none; border-radius: var(--radius-sm);
  font-family: 'Nunito', sans-serif;
  font-size: 14px; font-weight: 800;
  cursor: pointer; margin-top: 12px;
  transition: background 0.2s, transform 0.15s;
}
.place-order-btn:hover  { background: var(--accent2); }
.place-order-btn:active { transform: scale(0.98); }
.place-order-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.new-order-status {
  font-size: 12px; font-weight: 700;
  text-align: center; margin-top: 8px;
  min-height: 18px;
}
.new-order-status.success { color: var(--success); }
.new-order-status.error   { color: var(--danger); }

/* ── TABLE CARDS ── */
.table-card {
  background: var(--panel);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.table-card-header {
  padding: 12px 14px;
  display: flex; align-items: center; gap: 12px;
  border-bottom: 1px solid var(--border);
  background: #f8fafc;
}

.table-avatar {
  width: 42px; height: 42px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Playfair Display', serif;
  font-size: 15px; font-weight: 700;
  flex-shrink: 0;
}

.table-avatar.has-ready   { background: #f0fff4; color: #276749; }
.table-avatar.has-served  { background: #ebf8ff; color: #2c5282; }
.table-avatar.all-pending { background: #fffaf0; color: #744210; }

.table-meta { flex: 1; min-width: 0; }
.table-name { font-size: 15px; font-weight: 800; color: var(--text); }
.table-sub  { font-size: 12px; color: var(--muted); font-weight: 600; margin-top: 1px; }

.table-total-wrap { text-align: right; flex-shrink: 0; }
.table-total-amt  { font-family: 'Playfair Display', serif; font-size: 18px; font-weight: 700; color: var(--text); }
.table-total-lbl  { font-size: 10px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; }

/* Order rows */
.order-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}
.order-row:last-of-type { border-bottom: none; }

.status-badge {
  padding: 3px 9px; border-radius: 100px;
  font-size: 11px; font-weight: 800;
  flex-shrink: 0; white-space: nowrap;
}
.status-Pending   { background: #fffaf0; color: #744210; border: 1px solid #fbd38d; }
.status-Preparing { background: #fff8e1; color: #7b3f00; border: 1px solid #f6ad55; }
.status-Ready     { background: #f0fff4; color: #276749; border: 1px solid #9ae6b4; }
.status-Served    { background: #ebf8ff; color: #2c5282; border: 1px solid #90cdf4; }
.status-Cancelled { background: #fff5f5; color: #742a2a; border: 1px solid #feb2b2; }
.status-Paid      { background: #f0fff4; color: #276749; border: 1px solid #9ae6b4; }

.order-info { flex: 1; min-width: 0; }
.order-items-text { font-size: 13px; color: var(--text2); font-weight: 600; line-height: 1.4; }
.order-notes-text { font-size: 11px; color: var(--muted); margin-top: 2px; font-style: italic; }

.serve-btn {
  padding: 6px 12px; border-radius: 8px;
  background: var(--success); color: #fff;
  border: none; font-family: 'Nunito', sans-serif;
  font-size: 12px; font-weight: 800;
  cursor: pointer; flex-shrink: 0;
  transition: all 0.15s;
}
.serve-btn:hover   { background: #219a52; }
.serve-btn:active  { transform: scale(0.96); }
.serve-btn:disabled { opacity: 0.35; cursor: not-allowed; }

/* Table card footer */
.table-card-footer {
  display: flex; gap: 8px;
  padding: 10px 14px;
  background: #f8fafc;
  border-top: 1px solid var(--border);
}

.print-btn {
  flex: 1; padding: 10px;
  background: #fff; color: var(--text);
  border: 1.5px solid var(--border2);
  border-radius: var(--radius-sm);
  font-family: 'Nunito', sans-serif;
  font-size: 13px; font-weight: 700;
  cursor: pointer; transition: all 0.15s;
}
.print-btn:hover { border-color: var(--accent); color: var(--accent); }

.paid-btn {
  flex: 1; padding: 10px;
  background: var(--accent); color: #fff;
  border: none; border-radius: var(--radius-sm);
  font-family: 'Nunito', sans-serif;
  font-size: 13px; font-weight: 800;
  cursor: pointer; transition: all 0.15s;
}
.paid-btn:hover   { background: var(--accent2); }
.paid-btn:active  { transform: scale(0.98); }
.paid-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── PAID HISTORY ── */
.paid-card {
  background: var(--panel);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 10px;
  display: flex; align-items: center; gap: 12px;
  box-shadow: var(--shadow);
}

.paid-avatar {
  width: 44px; height: 44px; border-radius: 12px;
  background: #f0fff4; color: #276749;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Playfair Display', serif;
  font-size: 14px; font-weight: 700; flex-shrink: 0;
}

.paid-info { flex: 1; min-width: 0; }
.paid-table { font-size: 15px; font-weight: 800; color: var(--text); }
.paid-sub   { font-size: 12px; color: var(--muted); font-weight: 600; margin-top: 2px; }

.paid-amount {
  font-family: 'Playfair Display', serif;
  font-size: 18px; font-weight: 700; color: var(--success);
  text-align: right; flex-shrink: 0;
}

/* ── CANCELLED ── */
.cancelled-card {
  background: var(--panel);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 8px;
  box-shadow: var(--shadow);
}
.cancelled-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.cancelled-table  { font-size: 14px; font-weight: 700; color: var(--text2); }
.cancelled-time   { font-size: 11px; color: var(--muted); }
.cancelled-items  { font-size: 13px; color: var(--muted); }

/* ── EMPTY STATE ── */
.empty-state { text-align: center; padding: 48px 20px; }
.empty-icon  { font-size: 48px; margin-bottom: 12px; }
.empty-title { font-size: 16px; font-weight: 800; color: var(--text2); margin-bottom: 6px; }
.empty-sub   { font-size: 13px; color: var(--muted); }

/* ── NOTIFICATION BAR ── */
.notif-bar {
  background: var(--success); color: #fff;
  padding: 10px 16px; font-size: 13px; font-weight: 700;
  text-align: center; animation: slideDown 0.3s ease;
}
@keyframes slideDown { from { transform: translateY(-100%); opacity: 0; } to { transform: translateY(0); opacity: 1; } }