* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: Arial, sans-serif; background:#f9f9f9; }

#table-bar {
  background:#fff; padding:10px;
  display:flex; align-items:center; gap:10px;
  border-bottom:1px solid #ddd;
}
#tables button {
  margin-right:5px;
  padding:8px 12px;
  border:none; border-radius:4px;
  background:#eee;
  cursor:pointer;
}
#tables button.active { background:#87cefa; color:#fff; }
#admin-btn { margin-right:auto; }

#main { display:flex; }
#menu {
  flex:1;
  padding:20px;
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(150px,1fr));
  gap:15px;
  max-height:calc(100vh - 60px);
  overflow-y:auto;
}
.card {
  background:#fff;
  border-radius:6px;
  box-shadow:0 1px 3px rgba(0,0,0,0.1);
  padding:10px;
  text-align:center;
}
.card img { width:100%; height:100px; object-fit:cover; border-radius:4px; }
.card h3 { font-size:16px; margin:10px 0 5px; }
.card p { margin-bottom:8px; }
.card .qty { width:50px; }
.card button { padding:5px 10px; border:none; border-radius:4px; background:#28a745; color:#fff; cursor:pointer; }

#receipt {
  width:300px;
  background:#fff;
  padding:20px;
  box-shadow:0 1px 5px rgba(0,0,0,0.1);
  position:sticky; top:0; align-self:flex-start;
  height:calc(100vh - 40px);
  display:flex; flex-direction:column;
}
#receipt ul { flex:1; overflow-y:auto; list-style:none; margin:10px 0; }
#receipt li { display:flex; justify-content:space-between; margin-bottom:8px; }
#receipt li button { background:none; border:none; color:#dc3545; cursor:pointer; }
#print-btn { padding:10px; border:none; border-radius:4px; background:#007bff; color:#fff; cursor:pointer; }

/* print only receipt */
@media print {
  body * { visibility:hidden; }
  #receipt, #receipt * { visibility:visible; }
  #receipt { position:absolute; top:0; left:0; width:100%; }
}

/* ── Layout ───────────────────────────────────────────────────────── */
#main {
  display: flex;
  height: calc(100vh - 50px);
}

/* Orders Panel */
#orders-panel {
  width: 260px;
  background: #fff;
  border-left: 1px solid #ddd;
  padding: 10px;
  overflow-y: auto;
}
#orders-panel h3 {
  margin-top: 0;
  text-align: center;
}
#orders-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
#orders-list li {
  margin-bottom: 1em;
  padding: 0.5em;
  border: 1px solid #eee;
  border-radius: 5px;
}

/* Menu */
#menu {
  flex: 2;
  overflow-y: auto;
}

/* Receipt */
#receipt {
  width: 280px;
  background: #fff;
  padding: 15px;
  border-left: 1px solid #ddd;
  display: flex;
  flex-direction: column;
}
#receipt .receipt-header {
  text-align: center;
  margin-bottom: 10px;
}
#order-list {
  flex: 1;
  list-style: none;
  padding: 0;
  margin: 0 0 10px;
  overflow-y: auto;
}
#total {
  font-weight: bold;
  margin-bottom: 10px;
  text-align: center;
}
.phrase {
  font-style: italic;
  text-align: center;
  color: #555;
  min-height: 2em;
  margin-bottom: 10px;
}
.btn-print {
  width: 100%;
}

/* Buttons */
.btn {
  margin: 0 5px 5px 0;
  padding: 5px 10px;
  border: none;
  background: #007bff;
  color: #fff;
  border-radius: 4px;
  cursor: pointer;
}
.btn-print {
  background: #28a745;
}
/* === Simple Lock Overlay === */
.lock-overlay{
  position:fixed; inset:0; z-index:9999;
  display:flex; align-items:center; justify-content:center;
  background: rgba(240,242,245,.98);
  backdrop-filter: blur(2px);
}
.lock-card{
  width:340px; max-width:90vw;
  background:#fff; border-radius:12px;
  box-shadow:0 8px 24px rgba(0,0,0,.15);
  padding:20px; text-align:center;
}
.lock-card h2{ margin:0 0 12px; }
.lock-card input{
  width:100%; padding:10px 12px; border:1px solid #ccc;
  border-radius:8px; font-size:16px;
}
.lock-card button{
  margin-top:12px; width:100%; padding:10px 12px;
  border:none; border-radius:8px; background:#007bff; color:#fff;
  font-size:16px; cursor:pointer;
}
.lock-error{ margin-top:8px; color:#dc3545; font-size:.9rem; display:none; }
.lock-show{ margin-top:8px; display:flex; align-items:center; gap:6px; }
.lock-foot{ margin-top:10px; font-size:.85rem; color:#666; }
