/* Restaurant OS Pro v2 — Executive Liquid Glass UI + Performance Mode */
:root {
  --brand: #ea580c;
  --brand-soft: rgba(234, 88, 12, 0.11);
  --green: #059669;
  --green-soft: rgba(5, 150, 105, 0.11);
  --blue: #2563eb;
  --blue-soft: rgba(37, 99, 235, 0.11);
  --amber: #d97706;
  --red: #dc2626;
  --red-soft: rgba(220, 38, 38, 0.11);

  --bg: #f1f5f9;
  --surface: #ffffff;
  --surface-alt: #f8fafc;
  --border: rgba(15, 23, 42, 0.09);
  --border-strong: rgba(15, 23, 42, 0.14);
  --text: #0f172a;
  --muted: #64748b;
  --shadow: 0 8px 28px rgba(15, 23, 42, 0.06);
  --shadow-sm: 0 2px 10px rgba(15, 23, 42, 0.04);
  --radius: 18px;

  /* Liquid Glass Tokens */
  --glass-bg: rgba(255, 255, 255, 0.72);
  --glass-alt: rgba(255, 255, 255, 0.52);
  --glass-border: rgba(255, 255, 255, 0.75);
  --glass-inner: inset 0 1px 0 rgba(255, 255, 255, 0.85), inset 0 -1px 0 rgba(15, 23, 42, 0.04);
  --glass-blur: blur(18px) saturate(165%);
}

[data-theme="dark"] {
  --bg: #070b14;
  --surface: #111827;
  --surface-alt: #1a2335;
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #f8fafc;
  --muted: #94a3b8;
  --shadow: 0 12px 34px rgba(0, 0, 0, 0.42);

  --glass-bg: rgba(17, 24, 39, 0.70);
  --glass-alt: rgba(30, 41, 59, 0.52);
  --glass-border: rgba(255, 255, 255, 0.13);
  --glass-inner: inset 0 1px 0 rgba(255, 255, 255, 0.14), inset 0 -1px 0 rgba(0, 0, 0, 0.25);
}

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

html, body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
  letter-spacing: -0.01em;
}

/* Liquid Glass Ambient Canvas when ON */
body[data-glass="on"] {
  background:
    radial-gradient(circle at 12% 10%, rgba(234, 88, 12, 0.13), transparent 36%),
    radial-gradient(circle at 88% 16%, rgba(37, 99, 235, 0.11), transparent 38%),
    radial-gradient(circle at 50% 95%, rgba(5, 150, 105, 0.10), transparent 42%),
    var(--bg);
  background-attachment: fixed;
}
[data-theme="dark"] body[data-glass="on"],
body[data-glass="on"][data-theme="dark"] {
  background:
    radial-gradient(circle at 12% 10%, rgba(234, 88, 12, 0.18), transparent 38%),
    radial-gradient(circle at 88% 18%, rgba(37, 99, 235, 0.16), transparent 40%),
    radial-gradient(circle at 50% 95%, rgba(5, 150, 105, 0.14), transparent 44%),
    var(--bg);
  background-attachment: fixed;
}

/* RTL typography only when customer switches to Urdu/Arabic */
[dir="rtl"] {
  font-family: "Segoe UI", Tahoma, Arial, sans-serif;
  letter-spacing: 0;
}

.ico { display: inline-block; vertical-align: middle; flex-shrink: 0; }

button, input, select, textarea { font-family: inherit; }
button { cursor: pointer; border: none; background: none; color: inherit; }

input, select, textarea {
  background: var(--surface-alt);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: 11px;
  padding: 10px 13px;
  font-size: 13.5px;
  width: 100%;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

.hidden { display: none !important; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 15px; border-radius: 11px; font-weight: 600; font-size: 13px;
  letter-spacing: -0.01em;
  transition: transform 0.12s, opacity 0.15s, background 0.15s, box-shadow 0.15s;
  white-space: nowrap;
}
.btn:active { transform: scale(0.98); }
.btn-brand { background: var(--brand); color: #fff; box-shadow: 0 4px 14px rgba(234, 88, 12, 0.25); }
.btn-brand:hover { filter: brightness(1.05); }
.btn-green { background: var(--green); color: #fff; }
.btn-blue { background: var(--blue); color: #fff; }
.btn-red { background: var(--red); color: #fff; }
.btn-outline { background: var(--surface); border: 1px solid var(--border-strong); color: var(--text); }
.btn-outline:hover { background: var(--surface-alt); }
.btn-soft { background: var(--brand-soft); color: var(--brand); }
.btn-sm { padding: 7px 11px; font-size: 12px; border-radius: 9px; }
.btn-lg { padding: 13px 20px; font-size: 14.5px; border-radius: 13px; width: 100%; }

/* Liquid Glass Surfaces (Active when body[data-glass="on"]) */
body[data-glass="on"] .card,
body[data-glass="on"] .login-card,
body[data-glass="on"] .modal-box,
body[data-glass="on"] .sidebar,
body[data-glass="on"] .topbar,
body[data-glass="on"] .cust-bottom-bar,
body[data-glass="on"] .dish-card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow), var(--glass-inner);
}
body[data-glass="on"] .kds-col {
  background: var(--glass-alt);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
}
body[data-glass="on"] .btn-outline {
  background: var(--glass-alt);
  border-color: var(--border-strong);
}

/* Badges & Pills */
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 999px; font-size: 11px; font-weight: 700;
  letter-spacing: 0.02em; text-transform: uppercase;
}
.pill-brand { background: var(--brand-soft); color: var(--brand); }
.pill-green { background: var(--green-soft); color: var(--green); }
.pill-blue { background: var(--blue-soft); color: var(--blue); }
.pill-red { background: var(--red-soft); color: var(--red); }
.pill-muted { background: var(--surface-alt); color: var(--muted); border: 1px solid var(--border); }

/* Login Screen */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.login-card {
  width: 100%; max-width: 470px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 24px; padding: 30px; box-shadow: var(--shadow);
}
.login-logo {
  width: 52px; height: 52px; border-radius: 15px; background: var(--brand); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 800;
  margin-bottom: 14px; overflow: hidden;
}
.role-quick-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 18px 0; }
.role-quick-btn {
  padding: 12px; border-radius: 14px; border: 1px solid var(--border-strong);
  background: var(--surface-alt); text-align: left; transition: all 0.15s;
  display: flex; flex-direction: column; gap: 3px;
}
.role-quick-btn:hover { border-color: var(--brand); background: var(--brand-soft); }
.role-quick-btn strong { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; }
.role-quick-btn span { font-size: 11.5px; color: var(--muted); }

/* App Shell */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 264px; background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; padding: 18px 14px; position: sticky; top: 0; height: 100vh;
  overflow-y: auto; flex-shrink: 0; z-index: 40;
}
.brand-header { display: flex; align-items: center; gap: 11px; padding-bottom: 14px; border-bottom: 1px solid var(--border); margin-bottom: 14px; }
.brand-avatar {
  width: 40px; height: 40px; border-radius: 12px; background: var(--brand); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 17px;
  overflow: hidden; flex-shrink: 0;
}
.brand-avatar img { width: 100%; height: 100%; object-fit: cover; }

.nav-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  width: 100%; padding: 10px 12px; border-radius: 11px; font-size: 13px; font-weight: 600;
  color: var(--muted); margin-bottom: 3px; text-align: left; transition: all 0.15s;
}
.nav-item .nav-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.nav-item:hover { background: var(--surface-alt); color: var(--text); }
.nav-item.active { background: var(--brand); color: #fff; box-shadow: 0 4px 12px rgba(234, 88, 12, 0.25); }
.nav-badge {
  background: var(--red); color: #fff; font-size: 11px; font-weight: 700;
  padding: 1px 7px; border-radius: 999px;
}
.nav-item.active .nav-badge { background: #fff; color: var(--brand); }

.main-area { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  background: var(--surface); border-bottom: 1px solid var(--border);
  padding: 12px 24px; display: flex; align-items: center; justify-content: space-between;
  gap: 12px; position: sticky; top: 0; z-index: 30; flex-wrap: wrap;
}
.content { padding: 22px 24px; max-width: 1440px; width: 100%; margin: 0 auto; }

/* Cards & Grids */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow);
}
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.kpi-val { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; margin: 6px 0 4px; }
.kpi-label { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }

/* Selectable Table Card */
.table-card {
  padding: 16px; border-radius: 16px; border: 1.5px solid var(--border-strong);
  background: var(--surface-alt); text-align: center; cursor: pointer;
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.table-card:hover { transform: translateY(-2px); border-color: var(--brand); }
.table-card.selected {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
  background: var(--surface);
}

/* Kanban KDS */
.kds-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }
.kds-col { background: var(--surface-alt); border: 1px solid var(--border); border-radius: 18px; padding: 12px; min-height: 440px; }
.kds-col-header {
  padding: 10px 14px; border-radius: 12px; color: #fff; font-weight: 700; font-size: 13px;
  letter-spacing: 0.03em; display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px;
}
.kds-card {
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: 14px;
  padding: 14px; margin-bottom: 12px; box-shadow: var(--shadow-sm);
}
.kds-card.overdue { border-color: var(--red); background: var(--red-soft); }
.sla-timer { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 15px; font-weight: 800; padding: 4px 10px; border-radius: 8px; }

/* Toggle Switch */
.switch { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute; cursor: pointer; inset: 0; background: #cbd5e1;
  transition: .2s; border-radius: 999px;
}
.slider:before {
  position: absolute; content: ""; height: 18px; width: 18px; left: 3px; bottom: 3px;
  background: white; transition: .2s; border-radius: 50%; box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
input:checked + .slider { background: var(--green); }
input:checked + .slider:before { transform: translateX(20px); }

/* Customer Mobile App — Sleek Executive Design */
.customer-shell {
  max-width: 500px; margin: 0 auto; min-height: 100vh;
  padding-bottom: 96px; position: relative;
}
.cust-hero {
  background: linear-gradient(135deg, var(--brand), #c2410c);
  color: #fff; padding: 20px 18px 22px;
  border-bottom-left-radius: 26px; border-bottom-right-radius: 26px;
  box-shadow: 0 10px 28px rgba(234, 88, 12, 0.24);
}
.cust-top-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; gap: 8px; }
.cust-table-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255, 255, 255, 0.18); backdrop-filter: blur(8px);
  padding: 5px 11px; border-radius: 999px; font-size: 11.5px; font-weight: 700;
}
.cust-action-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.cust-action-btn {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  padding: 10px 12px; border-radius: 12px; font-weight: 700; font-size: 12.5px;
}
.cat-strip { display: flex; gap: 8px; overflow-x: auto; padding: 14px 16px; scrollbar-width: none; }
.cat-strip::-webkit-scrollbar { display: none; }
.cat-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 999px; border: 1px solid var(--border-strong);
  background: var(--surface); font-size: 12.5px; font-weight: 600; white-space: nowrap;
}
.cat-chip.active { background: var(--brand); color: #fff; border-color: var(--brand); }

.dish-card {
  display: flex; align-items: center; gap: 13px;
  padding: 14px; margin: 0 16px 12px; border-radius: 18px;
  border: 1px solid var(--border); background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.dish-icon-box {
  width: 54px; height: 54px; border-radius: 15px;
  background: var(--brand-soft); color: var(--brand);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.cust-bottom-bar {
  position: fixed; bottom: 12px; left: 50%; transform: translateX(-50%);
  width: calc(100% - 28px); max-width: 472px; background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: 18px;
  padding: 11px 16px; box-shadow: 0 12px 32px rgba(15, 23, 42, 0.16);
  display: flex; align-items: center; justify-content: space-between; gap: 10px; z-index: 50;
}

/* Modal */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(15, 23, 42, 0.52);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 100;
}
.modal-box {
  background: var(--surface); border: 1px solid var(--border); border-radius: 22px;
  width: 100%; max-width: 520px; max-height: 90vh; overflow-y: auto; padding: 24px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.28);
}

/* 3D Food Turntable */
.stage-3d {
  width: 100%; height: 250px; border-radius: 16px; position: relative; overflow: hidden;
  background: radial-gradient(circle at center, #fff7ed, #fed7aa 70%, #fdba74);
  display: flex; align-items: center; justify-content: center; user-select: none; cursor: grab;
}
.stage-3d:active { cursor: grabbing; }
.ar-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; }
.canvas-3d { position: relative; z-index: 2; }

/* Toast */
.toast-container { position: fixed; top: 18px; right: 18px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: #0f172a; color: #fff; padding: 11px 16px; border-radius: 12px;
  font-size: 13px; font-weight: 600; box-shadow: 0 10px 28px rgba(0,0,0,0.25);
  border-left: 4px solid var(--brand); animation: slideIn 0.2s ease;
}
@keyframes slideIn { from { transform: translateX(24px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* Data Table */
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th, .data-table td { padding: 11px 12px; text-align: left; border-bottom: 1px solid var(--border); }
.data-table th { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); font-weight: 700; }

/* Mobile Responsive */
.mobile-menu-btn { display: none; }
@media (max-width: 980px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3, .kds-grid { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: -280px; transition: left 0.2s; }
  .sidebar.open { left: 0; }
  .mobile-menu-btn { display: inline-flex; }
}

/* Print QR / NFC Table Tent Cards */
@media print {
  body * { visibility: hidden; }
  #print-area, #print-area * { visibility: visible; }
  #print-area {
    position: absolute; left: 0; top: 0; width: 100%;
    display: grid !important; grid-template-columns: repeat(2, 1fr); gap: 18px;
    padding: 12px;
  }
}
