﻿* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, Segoe UI, Roboto, sans-serif;
  background: #f4f5f7;
  color: #1a1a1a;
}

.topbar {
  background: #1f2937;
  color: white;
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.topbar h1 { font-size: 18px; margin: 0; }
#table-select-wrap { display: flex; gap: 10px; align-items: center; }
select, input, button {
  font-size: 16px;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid #ccc;
}
button { cursor: pointer; }

.layout {
  display: flex;
  gap: 12px;
  padding: 12px;
  flex-wrap: wrap;
}

.menu-panel { flex: 2; min-width: 300px; }
.order-panel {
  flex: 1;
  min-width: 280px;
  background: white;
  border-radius: 10px;
  padding: 16px;
  height: fit-content;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.tabs button {
  background: white;
  border: 1px solid #d1d5db;
}
.tabs button.active { background: #2563eb; color: white; }

.menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}
.menu-item-card {
  background: white;
  border-radius: 10px;
  padding: 14px 10px;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  cursor: pointer;
  user-select: none;
}
.menu-item-card:active { background: #e0e7ff; }
.menu-item-card .price { color: #6b7280; font-size: 14px; margin-top: 4px; }
.menu-item-card.unavailable { opacity: 0.4; pointer-events: none; }

#order-items { list-style: none; padding: 0; margin: 10px 0; max-height: 40vh; overflow-y: auto; }
#order-items li {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid #eee;
  font-size: 14px;
}
#order-items li button {
  background: none;
  border: none;
  color: #dc2626;
  font-size: 16px;
  padding: 0 6px;
}

.totals div { display: flex; justify-content: space-between; margin: 4px 0; font-size: 14px; }
.totals .grand { font-weight: bold; font-size: 17px; margin-top: 8px; }
.totals input { width: 80px; text-align: right; }

.pay-buttons { display: flex; gap: 8px; margin-top: 14px; }
.pay-btn { flex: 1; background: #2563eb; color: white; border: none; }
.pay-btn[data-method="room_charge"] { background: #059669; }

.hidden { display: none; }
#room-charge-panel { margin-top: 10px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.void-btn {
  margin-top: 14px;
  width: 100%;
  background: white;
  border: 1px solid #dc2626;
  color: #dc2626;
}

/* ---- Login overlay ---- */
.overlay {
  position: fixed; inset: 0; background: rgba(17,24,39,0.9);
  display: flex; align-items: center; justify-content: center; z-index: 100;
}
.overlay.hidden { display: none; }
.login-box {
  background: white; border-radius: 12px; padding: 30px; width: 280px;
  text-align: center;
}
.login-box input { width: 100%; margin: 12px 0; text-align: center; font-size: 20px; }
.login-box button { width: 100%; background: #2563eb; color: white; border: none; padding: 10px; }
.login-box .hint { font-size: 12px; color: #888; margin-top: 10px; }
.error { color: #dc2626; font-size: 14px; }

/* ---- Nav / staff badge ---- */
.nav-links { display: flex; gap: 14px; }
.nav-links a { color: #cbd5e1; text-decoration: none; font-size: 14px; }
.nav-links a:hover { color: white; }
#staff-badge { color: #a5b4fc; font-size: 13px; margin-right: 8px; }

.seat-picker { margin-bottom: 8px; font-size: 14px; }

.secondary-btn {
  width: 100%; margin-top: 10px; background: white; border: 1px solid #d1d5db; padding: 8px;
}

/* ---- Split panel ---- */
#split-panel { margin-top: 10px; border-top: 1px solid #eee; padding-top: 10px; }
.seat-block { border: 1px solid #e5e7eb; border-radius: 8px; padding: 8px; margin-bottom: 8px; }
.seat-block h4 { margin: 0 0 6px 0; }
.seat-block select { width: 100%; margin-top: 4px; }

/* ---- KDS ---- */
.kds-layout { display: flex; gap: 12px; padding: 16px; }
.kds-column { flex: 1; background: #f4f5f7; border-radius: 10px; padding: 10px; min-height: 70vh; }
.kds-column h2 { text-align: center; font-size: 16px; }
.kds-cards { display: flex; flex-direction: column; gap: 8px; }
.kds-card {
  background: white; border-radius: 8px; padding: 10px; box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  cursor: pointer;
}
.kds-card .kds-title { font-weight: bold; }
.kds-card .kds-meta { font-size: 12px; color: #6b7280; }
.kds-card.pending { border-left: 4px solid #f59e0b; }
.kds-card.preparing { border-left: 4px solid #2563eb; }
.kds-card.ready { border-left: 4px solid #059669; }

/* ---- Reports ---- */
.report-layout { padding: 16px; }
.report-grid { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.report-card {
  background: white; border-radius: 10px; padding: 16px 20px; box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  min-width: 140px;
}
.report-label { font-size: 13px; color: #6b7280; }
.report-value { font-size: 22px; font-weight: bold; margin-top: 4px; }
.report-tables { display: flex; gap: 20px; flex-wrap: wrap; }
.report-tables table { border-collapse: collapse; background: white; min-width: 220px; }
.report-tables td { padding: 6px 12px; border-bottom: 1px solid #eee; font-size: 14px; }

.tiny-btn {
  background: #374151; color: white; border: none; padding: 6px 10px; font-size: 13px;
}

.tagline {
  font-weight: normal;
  font-size: 13px;
  color: #9ca3af;
  margin-left: 8px;
}

/* ---- Manage page ---- */
.manage-layout { padding: 16px; display: flex; flex-direction: column; gap: 24px; }
.manage-section { background: white; border-radius: 10px; padding: 16px; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
.manage-row { display: flex; gap: 8px; margin-bottom: 12px; align-items: center; }
.manage-row.wrap { flex-wrap: wrap; }
.manage-table { width: 100%; border-collapse: collapse; }
.manage-table th, .manage-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid #eee; font-size: 14px; }
.chip { display: inline-block; background: #eef2ff; color: #3730a3; padding: 4px 10px; border-radius: 999px; font-size: 13px; margin: 2px; }

/* ---- QR codes page ---- */
.qr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; padding: 16px; }
.qr-card { background: white; border: 1px solid #e5e7eb; border-radius: 10px; padding: 14px; text-align: center; }
.qr-card img { width: 100%; max-width: 180px; }
.qr-label { font-weight: bold; margin-top: 8px; }
@media print {
  .no-print { display: none !important; }
  .qr-card { break-inside: avoid; }
}

/* ---- Bill-requested badge on POS ---- */
.bill-badge {
  background: #f59e0b; color: white; font-size: 12px; padding: 3px 8px; border-radius: 6px; margin-left: 8px;
}

.hint { font-size: 12px; color: #888; margin: 6px 0; }

/* ---- Brand / logo ---- */
.brand { display: flex; align-items: center; gap: 10px; }
.brand-icon { width: 28px; height: 28px; border-radius: 7px; flex-shrink: 0; }
.brand-pos { color: #60a5fa; }

.recipe-summary {
  background: #f9fafb; border-radius: 8px; padding: 12px; margin: 10px 0;
  font-size: 14px; display: flex; gap: 20px; flex-wrap: wrap;
}
.recipe-summary strong { display: block; font-size: 16px; }
.recipe-summary .warn { color: #dc2626; }

/* ---- Menu item photos ---- */
.item-thumb {
  width: 60px; height: 60px; object-fit: cover; border-radius: 8px; display: block;
}
.item-thumb-empty {
  display: flex; align-items: center; justify-content: center;
  background: #f3f4f6; color: #9ca3af; font-size: 11px; text-align: center;
}
.upload-label {
  display: inline-block; font-size: 12px; color: #2563eb; cursor: pointer; margin-top: 4px;
}
.upload-label:hover { text-decoration: underline; }

.menu-item-card { position: relative; padding-top: 0; overflow: hidden; }
.menu-item-card .card-photo {
  width: 100%; height: 90px; object-fit: cover; display: block; margin-bottom: 8px;
}
.menu-item-card .card-body { padding: 0 10px 14px; }

.login-logo { width: 140px; height: 140px; margin-bottom: 4px; }

/* ---- RTL / Arabic support ---- */
body.rtl { font-family: 'Tajawal', -apple-system, Segoe UI, Roboto, sans-serif; }
[dir="rtl"] .topbar { flex-direction: row-reverse; }
[dir="rtl"] .nav-links { flex-direction: row-reverse; }
[dir="rtl"] #table-select-wrap { flex-direction: row-reverse; }
[dir="rtl"] .layout { flex-direction: row-reverse; }
[dir="rtl"] .order-panel, [dir="rtl"] .manage-section, [dir="rtl"] .report-tables,
[dir="rtl"] .totals div, [dir="rtl"] .manage-row, [dir="rtl"] #order-items li,
[dir="rtl"] .pay-buttons, [dir="rtl"] .qty-controls, [dir="rtl"] .report-grid {
  direction: rtl;
}
[dir="rtl"] .totals div { justify-content: space-between; }
[dir="rtl"] .manage-table th, [dir="rtl"] .manage-table td { text-align: right; }
[dir="rtl"] .tabs { flex-direction: row-reverse; }
[dir="rtl"] .cart-bar { flex-direction: row-reverse; }
[dir="rtl"] .guest-header { direction: rtl; }
.lang-toggle { background: #374151; }

/* ---- Consolidated credit method panel ---- */
#credit-method-panel { margin-top: 10px; border-top: 1px solid #eee; padding-top: 10px; }
.credit-subchoice { display: flex; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.credit-subchoice button {
  flex: 1; min-width: 120px; background: #fff7ed; border: 1px solid #b45309; color: #b45309; padding: 10px;
}
.credit-subchoice button:hover { background: #fed7aa; }
#room-villa-subpanel, #credit-customer-subpanel, #installments-subpanel { margin-top: 8px; }

/* ---- Order type setup bar ---- */
.order-setup-bar {
  background: white; border-bottom: 1px solid #e5e7eb; padding: 10px 20px;
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}
.order-type-toggle { display: flex; gap: 4px; background: #f3f4f6; border-radius: 8px; padding: 3px; }
.order-type-btn { background: transparent; border: none; padding: 8px 14px; border-radius: 6px; color: #6b7280; }
.order-type-btn.active { background: #2563eb; color: white; }
#takeaway-fields, #delivery-fields, #dine-in-fields { display: flex; gap: 8px; align-items: center; }`r`n#takeaway-fields.hidden, #delivery-fields.hidden, #dine-in-fields.hidden { display: none; }

.order-type-badge {
  font-size: 12px; padding: 3px 8px; border-radius: 6px; margin-left: 8px;
  background: #ede9fe; color: #6d28d9;
}
#delivery-controls { background: #f9fafb; border-radius: 8px; padding: 10px; margin-bottom: 10px; }
.delivery-status-buttons { display: flex; gap: 8px; margin-top: 8px; }
.delivery-status-buttons button { flex: 1; }

/* ---- Dashboards ---- */
.dash-tabs { display: flex; gap: 4px; background: white; padding: 10px 16px; border-bottom: 1px solid #e5e7eb; flex-wrap: wrap; }
.dash-tab { background: #f3f4f6; border: none; padding: 10px 16px; border-radius: 8px; color: #374151; }
.dash-tab.active { background: #2563eb; color: white; }
.dash-panel h3 { margin-top: 24px; }

/* ============================================================
   Premium theme v2 â€” brand palette (deep charcoal + gold), refined
   typography, depth, and motion. Appended rather than rewritten inline
   so nothing upstream breaks; later rules win the cascade.
   ============================================================ */
:root {
  --ink: #15171c;
  --ink-soft: #23262f;
  --gold: #c9a227;
  --gold-light: #e2c14f;
  --gold-dark: #9c7d1a;
  --paper: #f8f6f1;
  --card: #ffffff;
  --border: #e8e3d8;
  --text: #1f2023;
  --text-muted: #6b6a63;
  --shadow-sm: 0 1px 3px rgba(21,23,28,0.08);
  --shadow-md: 0 4px 14px rgba(21,23,28,0.10);
  --shadow-lift: 0 10px 24px rgba(21,23,28,0.14);
  --radius: 12px;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, Segoe UI, Roboto, sans-serif;
  background: var(--paper);
  color: var(--text);
}
body.rtl { font-family: 'Tajawal', -apple-system, Segoe UI, Roboto, sans-serif; }

/* ---- Header: deep charcoal with a subtle gold underline ---- */
.topbar, .order-setup-bar ~ .dash-tabs, header.topbar {
  background: linear-gradient(180deg, var(--ink) 0%, var(--ink-soft) 100%);
  border-bottom: 2px solid var(--gold);
  box-shadow: var(--shadow-md);
}
.brand-pos, .nav-links a:hover { color: var(--gold-light) !important; }
.nav-links a { transition: color .15s ease; }
.tagline { color: #9a9a95 !important; }

/* ---- Primary buttons: gold, not blue ---- */
button { border-radius: 9px; transition: transform .1s ease, box-shadow .15s ease, filter .15s ease; }
button:active { transform: translateY(1px); }

#new-order-btn, #pin-submit, #save-store-settings-btn, #activate-license-btn,
#add-employee-btn, #add-table-btn, #add-category-btn, #add-item-btn, #add-ingredient-btn,
#add-card-btn, #add-credit-btn, #run-backup-now-btn, #sync-d365-btn, .billing-plan-btn,
#save-recipe-btn, #recipe-add-line-btn, #import-menu-csv-input, #confirm-room-charge, #confirm-credit, #confirm-bnpl, #loyalty-signup-btn, #loyalty-search-btn,
.order-type-btn.active, .dash-tab.active {
  background: linear-gradient(135deg, var(--gold-light), var(--gold-dark)) !important;
  color: var(--ink) !important;
  border: none !important;
  font-weight: 700;
  box-shadow: var(--shadow-sm);
}
#new-order-btn:hover, #pin-submit:hover, .billing-plan-btn:hover {
  filter: brightness(1.06);
  box-shadow: var(--shadow-md);
}

.pay-btn[data-method="cash"], .pay-btn[data-method="card"] { background: var(--ink) !important; }
.pay-btn { border-radius: 10px !important; font-weight: 600; }

/* ---- Cards: crisper shadow, gold hover lift on menu items ---- */
.menu-item-card, .order-panel, .report-card, .manage-section, .login-box, .cart-box,
.kds-column, .kds-card {
  border-radius: var(--radius) !important;
  box-shadow: var(--shadow-sm) !important;
  border: 1px solid var(--border);
}
.menu-item-card { transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease; cursor: pointer; }
.menu-item-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift) !important; border-color: var(--gold); }

.tabs button.active, .order-type-toggle .order-type-btn.active { 
  background: var(--ink) !important; color: var(--gold-light) !important; 
}

/* ---- Tables: quiet zebra striping, gold header rule ---- */
.manage-table thead tr, .report-tables th { border-bottom: 2px solid var(--gold); }
.manage-table tbody tr:nth-child(even) { background: #fbfaf6; }
.manage-table tbody tr:hover { background: #f5efdc; }

/* ---- Login box: a touch of ceremony ---- */
.login-box { padding: 32px 28px !important; }
.login-logo { filter: drop-shadow(0 6px 16px rgba(201,162,39,0.35)); }
#pin-submit { width: 100%; padding: 12px; font-size: 16px; }

/* ---- Totals / grand total gets gold emphasis ---- */
.totals .grand { color: var(--ink); border-top: 1px solid var(--border); padding-top: 8px; margin-top: 4px; }
.totals .grand span:last-child { color: var(--gold-dark); font-size: 19px; }

.report-value { color: var(--ink); }
.report-label { color: var(--text-muted) !important; letter-spacing: .02em; }

.digital-menu-qr-block {
  display: flex; gap: 16px; align-items: center; margin-top: 14px; padding-top: 14px;
  border-top: 1px solid var(--border, #eee);
}
.digital-menu-qr-block img { width: 110px; height: 110px; border: 1px solid var(--border, #eee); border-radius: 8px; }
.digital-menu-qr-block a { color: var(--gold-dark, #2563eb); font-weight: 600; }

.loyalty-lookup-block { margin-top: 10px; padding: 8px; background: #fffbea; border-radius: 8px; border: 1px solid #fde68a; }
.loyalty-lookup-block input { width: auto; }

/* ---- Shared footer (customer-facing pages) ---- */
.site-footer {
  background: var(--ink, #15171c); color: #d8d5c9; text-align: center;
  padding: 22px 16px 28px; margin-top: 24px;
}
.footer-social { display: flex; justify-content: center; gap: 14px; margin-bottom: 10px; }
.footer-social-icon {
  color: #d8d5c9; opacity: .85; transition: color .15s ease, opacity .15s ease, transform .15s ease;
}
.footer-social-icon:hover { color: var(--gold-light, #e2c14f); opacity: 1; transform: translateY(-2px); }
.footer-brand { font-size: 13px; color: #9a9a95; letter-spacing: .03em; }
.footer-credit { font-size: 11px; color: #5c5b57; margin-top: 4px; }

.whatsapp-float {
  position: fixed; bottom: 20px; right: 20px; width: 54px; height: 54px;
  background: #25d366; color: white; border-radius: 50%; display: flex;
  align-items: center; justify-content: center; box-shadow: 0 4px 14px rgba(0,0,0,0.25);
  z-index: 50; transition: transform .15s ease;
}
.whatsapp-float:hover { transform: scale(1.08); }
[dir="rtl"] .whatsapp-float { right: auto; left: 20px; }

/* ---- Offline mode banner ---- */
.offline-banner {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: #b45309; color: white; text-align: center; padding: 8px; font-size: 14px; font-weight: 600;
}


/* QR print cards */
.qr-card { min-height: 290px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.qr-card img { background: #fff; aspect-ratio: 1/1; object-fit: contain; }
.qr-card-menu { border: 2px solid #c9a227; background: #fffdf7; }
.qr-eyebrow { font-size: 10px; letter-spacing: .18em; color: #777; margin-bottom: 5px; }
.qr-store-name { font-size: 20px; font-weight: 800; margin-bottom: 10px; }
.qr-label { font-size: 18px; font-weight: 800; margin-top: 9px; }
.qr-help { color: #6b7280; font-size: 11px; margin-top: 3px; }
.qr-target { width: 100%; margin-top: 8px; font-size: 9px; line-height: 1.25; color: #9ca3af; word-break: break-all; }
.qr-image-error { border: 2px dashed #dc2626; }
.qr-error, .qr-loading { grid-column: 1 / -1; padding: 30px; text-align: center; color: #6b7280; }
@media print { .qr-target { display: none; } .qr-card { min-height: 260px; } }


#takeaway-fields.hidden, #delivery-fields.hidden, #dine-in-fields.hidden { display: none !important; }

/* Mchils v2 operational enhancements */
.kds-age { font-weight:700; margin-top:4px; }
.kds-age.overdue { color:#b91c1c; background:#fee2e2; display:inline-block; padding:2px 6px; border-radius:6px; }
.online-shell { max-width:1180px; margin:0 auto; padding:16px; }
.online-header { display:flex; justify-content:space-between; gap:12px; align-items:center; margin-bottom:16px; }
.online-grid { display:grid; grid-template-columns:1fr 340px; gap:18px; }
.online-menu-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(180px,1fr)); gap:12px; }
.online-card { background:#fff; border:1px solid #e5e7eb; border-radius:12px; overflow:hidden; padding-bottom:10px; }
.online-card img { width:100%; height:130px; object-fit:cover; }
.online-card-body { padding:10px; }
.online-cart { background:#fff; border:1px solid #e5e7eb; border-radius:12px; padding:14px; position:sticky; top:12px; height:max-content; }
.online-fields { display:grid; gap:8px; margin:12px 0; }
.online-fields input,.online-fields select,.online-fields textarea { padding:10px; border:1px solid #cbd5e1; border-radius:8px; }
.status-steps { display:grid; grid-template-columns:repeat(5,1fr); gap:8px; margin:18px 0; }
.status-step { padding:10px 6px; text-align:center; border-radius:8px; background:#e5e7eb; font-size:13px; }
.status-step.active { background:#d4a91e; color:#111; font-weight:800; }
.share-row { display:flex; flex-wrap:wrap; gap:8px; margin-top:14px; }
@media (max-width:800px){ .online-grid{grid-template-columns:1fr}.online-cart{position:static}.status-steps{grid-template-columns:1fr} }
