* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
:root {
  --bg: #0a0a0a;
  --panel: #111111;
  --panel2: #1a1a1a;
  --text: #ffffff;
  --muted: #999999;
  --accent: #f5c400;
  --accent-dark: #c49b00;
  --danger: #e53935;
  --success: #2e7d32;
}
html, body { margin:0; height:100%; font-size:16px; }
body {
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #0a0a0a;
  color: var(--text);
  min-height: 100vh;
  user-select: none;
}
.app-shell {
  max-width: 1400px;
  margin: 0 auto;
  padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
}
.topbar {
  background: linear-gradient(90deg, #1a1a00, #111100);
  border: 2px solid var(--accent);
  border-radius: 14px;
  padding: 14px 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.brand-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand { font-size: 1.7rem; font-weight: 900; color: var(--accent); letter-spacing: 1px; text-transform: uppercase; }
.lang-toggle {
  display: inline-flex;
  border: 1px solid #4a4a00;
  border-radius: 999px;
  overflow: hidden;
}
.lang-btn {
  border: 0;
  background: #222200;
  color: #d7d7d7;
  padding: 6px 10px;
  font-weight: 800;
  cursor: pointer;
  min-width: 46px;
}
.lang-btn.active {
  background: var(--accent);
  color: #000;
}
.currency-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid #3e3e3e;
  border-radius: 999px;
  background: linear-gradient(90deg, #220d0d 0%, #0e1e3f 100%);
  padding: 3px;
}
.currency-btn {
  border: 1px solid #3e3e3e;
  background: #151515;
  color: #e2e2e2;
  padding: 6px 12px;
  font-weight: 800;
  cursor: pointer;
  font-size: 0.84rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background .15s, color .15s, border-color .15s, transform .15s;
}
.currency-btn .flag {
  font-size: 0.95rem;
  line-height: 1;
}
.currency-btn .label {
  letter-spacing: 0.3px;
}
.currency-btn.lb {
  background: rgba(129, 24, 24, 0.24);
  border-color: rgba(219, 74, 74, 0.45);
}
.currency-btn.us {
  background: rgba(24, 58, 124, 0.28);
  border-color: rgba(92, 145, 255, 0.45);
}
.currency-btn:hover {
  background: #232323;
  color: #fff;
  border-color: #888;
  transform: translateY(-1px);
}
.currency-btn.active {
  color: #fff;
  border-color: transparent;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08) inset;
}
.currency-btn.lb.active {
  background: #d62f2f;
}
.currency-btn.us.active {
  background: #2b67d6;
}
.subtitle { font-size: 0.82rem; color: #aaa; margin-top: 2px; }
.user-badge {
  font-size: 0.95rem;
  background: var(--accent);
  color: #000;
  border-radius: 999px;
  padding: 8px 18px;
  font-weight: 800;
}
.layout { display: grid; grid-template-columns: 220px 1fr; gap: 12px; margin-top: 12px; }
.layout.signed-out {
  grid-template-columns: minmax(320px, 680px);
  justify-content: center;
}
.sidebar {
  background: #111;
  border-radius: 14px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  border: 2px solid #2a2a00;
}
.navBtn {
  border: 2px solid transparent;
  background: #1a1a1a;
  color: #ccc;
  padding: 16px 14px;
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
  font-weight: 700;
  font-size: 1rem;
  transition: .15s;
  min-height: 54px;
}
html[dir="rtl"] .navBtn { text-align: right; }
html[dir="ltr"] .navBtn { text-align: left; }
.navBtn:hover, .navBtn:active { background: #2a2a00; color: var(--accent); border-color: var(--accent); }
.navBtn.active { background: var(--accent); color: #000; border-color: var(--accent); font-weight: 900; }
.content {
  background: #111;
  border: 2px solid #2a2a00;
  border-radius: 14px;
  padding: 14px;
  min-height: calc(100vh - 140px);
}
.layout.signed-out .content {
  width: 100%;
  min-height: auto;
}
.layout.signed-out #loginPanel {
  margin-bottom: 0;
}
.panel {
  background: #161600;
  border: 1px solid #2f2f00;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
}
.hidden { display: none; }
.inline-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; align-items: center; }
.primary {
  border: 0;
  padding: 16px 22px;
  border-radius: 10px;
  background: var(--accent);
  color: #000;
  font-weight: 800;
  cursor: pointer;
  font-size: 1rem;
  min-height: 52px;
  min-width: 100px;
  transition: background .15s;
}
.primary:active { background: var(--accent-dark); }
.danger {
  border: 0;
  padding: 16px 22px;
  border-radius: 10px;
  background: var(--danger);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
  font-size: 1rem;
  min-height: 52px;
  min-width: 80px;
}
.danger:active { background: #b71c1c; }
.split { display: grid; grid-template-columns: 1fr minmax(300px, 1.1fr); gap: 14px; }
.card {
  background: #1a1a00;
  border-radius: 12px;
  border: 1px solid #3a3a00;
  padding: 14px;
}
label { display: block; font-size: 0.92rem; margin-bottom: 8px; color: #ddd; font-weight: 600; }
input, select {
  width: 100%;
  padding: 14px 12px;
  margin-top: 4px;
  border-radius: 8px;
  border: 2px solid #333;
  background: #0d0d00;
  color: #fff;
  font-size: 1rem;
}
textarea {
  width: 100%;
  padding: 12px;
  margin-top: 4px;
  border-radius: 8px;
  border: 2px solid #333;
  background: #0d0d00;
  color: #fff;
  font-size: 0.95rem;
  resize: vertical;
  min-height: 120px;
}
input:focus, select:focus { outline: none; border-color: var(--accent); }
textarea:focus { outline: none; border-color: var(--accent); }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.chip {
  background: #2a2a00;
  border: 2px solid var(--accent);
  color: var(--accent);
  padding: 14px 20px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 800;
  font-size: 1rem;
  min-height: 50px;
  transition: .15s;
  letter-spacing: 0.3px;
}
.chip:hover { background: #3a3a00; }
.chip.active, .chip:active { background: var(--accent); color: #000; border-color: var(--accent); }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.item-card {
  background: #181800;
  border: 2px solid var(--accent);
  border-radius: 10px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.item-card strong { font-size: 1rem; color: var(--accent); }
.item-card .item-cat { font-size: 0.8rem; color: #888; }
.item-card .item-price { font-size: 1.1rem; color: #fff; font-weight: 700; }
.item-qty-actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 10px;
}
.item-card button {
  margin-top: 0;
  background: var(--accent);
  color: #000;
  border: none;
  border-radius: 8px;
  padding: 12px;
  cursor: pointer;
  font-weight: 800;
  font-size: 1rem;
  min-height: 46px;
  width: 100%;
}
.item-qty-actions button {
  min-height: 34px;
  padding: 6px 8px;
  font-size: 0.9rem;
}
.item-card button:active { background: var(--accent-dark); }
#orderItems {
  background: #0d0d00;
  border: 2px dashed #3a3a00;
  border-radius: 10px;
  padding: 10px;
  min-height: 140px;
  max-height: 320px;
  overflow-y: auto;
}
.order-summary {
  margin-top: 12px;
  background: #1a1a00;
  padding: 14px;
  border-radius: 10px;
  border: 2px solid #3a3a00;
  font-size: 1rem;
}
.total { font-weight: 900; font-size: 1.3rem; color: var(--accent); margin-top: 6px; }
.text-muted { color: #888; font-size: 0.88rem; margin-top: 8px; }
#menuList, #inventoryList, #userList { margin-top: 10px; display: grid; gap: 8px; }
.table-item {
  background: #1a1a00;
  border-radius: 10px;
  padding: 14px 12px;
  border: 1px solid #3a3a00;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  min-height: 58px;
}
.table-item span { display: block; font-size: 0.95rem; }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.summary { flex: 1; min-width: 220px; }
h2 { color: var(--accent); font-size: 1.3rem; margin: 0 0 10px 0; }
h3 { color: #ddd; font-size: 1.05rem; margin: 0 0 8px 0; }
h4 { color: var(--accent); font-size: 0.95rem; margin: 0 0 8px 0; }
.online-pill {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: #2f2f00;
  border: 1px solid var(--accent);
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.3px;
}
pre#receiptPreview { font-size: 0.9rem; line-height: 1.6; color: #ddd; }
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .split { grid-template-columns: 1fr; }
  .sidebar { flex-direction: row; overflow-x: auto; }
  .navBtn { white-space: nowrap; min-width: 110px; text-align: center; }
  .card-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }

  .currency-toggle {
    padding: 4px;
    gap: 6px;
  }
  .currency-btn {
    min-height: 44px;
    min-width: 86px;
    padding: 9px 14px;
    font-size: 0.95rem;
    gap: 8px;
  }
  .currency-btn .flag {
    font-size: 1.12rem;
  }
}

@media (max-width: 600px) {
  html, body { font-size: 15px; }
  .topbar {
    padding: 12px;
    flex-direction: column;
    align-items: flex-start;
  }
  .brand { font-size: 1.25rem; }
  .subtitle { font-size: 0.78rem; }
  .content {
    padding: 10px;
    min-height: auto;
  }
  .panel { padding: 12px; }
  .inline-row { gap: 8px; }
  .primary, .danger {
    width: 100%;
    min-height: 48px;
    padding: 12px 14px;
  }
  .chip {
    padding: 12px 14px;
    min-height: 44px;
  }
  .currency-btn {
    min-width: 92px;
    min-height: 48px;
    font-size: 0.98rem;
  }
  .item-card { padding: 12px; }
  #orderItems { max-height: 280px; }
  .table-item {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (pointer: coarse) {
  .currency-btn {
    min-height: 46px;
  }
}
