/* Owner admin dashboard. */

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 900px) { .grid-2 { grid-template-columns: 1fr; } }

.side-foot {
  margin-top: 8px; border-top: 1px solid rgba(255,255,255,.09); padding: 12px 6px 0; color: #94a3b8;
}
.side-foot #whoami { padding: 0 10px 6px; color: #8fa0b8; }
.side-foot .nav-item { color: #9fb0c6; }
.side-foot .nav-item:hover { color: #fff; }

.live-orders { max-height: 420px; overflow-y: auto; }
.live-row { display: flex; align-items: center; gap: 10px; padding: 11px 18px; border-bottom: 1px solid var(--line); transition: background .12s; }
.live-row:last-child { border-bottom: none; }
.live-row:hover { background: #f8fbfd; }
.live-row .no { font-weight: 800; min-width: 54px; letter-spacing: -.02em; }
.live-row .tbl { background: var(--primary-50); color: var(--primary-700); border: 1px solid var(--primary-100); padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.live-row .amt { margin-left: auto; font-weight: 700; }

.top-item { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.top-item:last-child { border-bottom: none; }
.top-item .rank { width: 26px; height: 26px; border-radius: 8px; background: var(--primary-50); color: var(--primary-700); display: grid; place-items: center; font-weight: 800; font-size: 12px; flex: none; }
.top-item .bar { height: 6px; border-radius: 4px; background: linear-gradient(90deg, #2dd4bf, #0d9488); margin-top: 5px; opacity: .75; }
.top-item .qty { margin-left: auto; font-weight: 700; }

/* ------------------------------ Menu editor ----------------------------- */
.cat-block { margin-bottom: 18px; overflow: hidden; }
.cat-head { display: flex; align-items: center; gap: 10px; padding: 13px 16px; background: linear-gradient(180deg, #fbfdff, #f8fafc); border-bottom: 1px solid var(--line); }
.cat-head h3 { font-size: 15px; }
.cat-items { padding: 4px 16px; }
.mi { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.mi:last-child { border-bottom: none; }
.mi-body { flex: 1; min-width: 0; }
.mi-name { font-weight: 600; display: flex; align-items: center; gap: 7px; }
.mi-desc { font-size: 12.5px; color: var(--muted); }
.mi-price { font-weight: 700; min-width: 70px; text-align: right; }
.veg-mark { width: 14px; height: 14px; border: 1.5px solid var(--green); border-radius: 3px; display: inline-grid; place-items: center; flex: none; }
.veg-mark::after { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--green); }
.veg-mark.nonveg { border-color: var(--red); } .veg-mark.nonveg::after { background: var(--red); }

/* -------------------------------- QR grid ------------------------------- */
.qr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; }
.qr-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px;
  text-align: center; box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s;
}
.qr-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.qr-card img { width: 100%; max-width: 170px; margin: 0 auto; border-radius: 10px; }
.qr-card .tname { font-weight: 800; font-size: 16px; margin-top: 10px; }
.qr-card .rname { font-size: 12px; color: var(--muted); }
.qr-card .hint { font-size: 11px; color: var(--muted); margin-top: 8px; line-height: 1.4; }

/* Print: only the QR stickers, cut along the edges. */
@media print {
  body { background: #fff; }
  /* Hide everything, then reveal just the QR grid. */
  body * { visibility: hidden !important; }
  #qr-grid, #qr-grid * { visibility: visible !important; }
  #qr-grid {
    position: absolute; left: 0; top: 0; width: 100%;
    display: grid !important; grid-template-columns: repeat(3, 1fr); gap: 12px;
  }
  .qr-card { border: 1px dashed #cbd5e1; box-shadow: none; break-inside: avoid; page-break-inside: avoid; }

  /* Printing one table tent from its modal: hide the full grid instead. */
  body:has(#modal:not(.hidden)) #qr-grid { display: none !important; }
  body:has(#modal:not(.hidden)) #modal .qr-card,
  body:has(#modal:not(.hidden)) #modal .qr-card * { visibility: visible !important; }
  body:has(#modal:not(.hidden)) #modal {
    position: absolute; inset: 0; background: #fff; display: block; padding: 0;
  }
  body:has(#modal:not(.hidden)) #modal .qr-card { width: 52%; margin: 0 auto; border: none; }
}

/* ------------------------------ Setup list ----------------------------- */
.setup-item {
  display: flex; align-items: flex-start; gap: 12px; padding: 11px 0;
  border-bottom: 1px solid var(--line);
}
.setup-item:last-child { border-bottom: none; }
.setup-check {
  width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); flex: none;
  display: grid; place-items: center; font-size: 12px; font-weight: 800; color: transparent; margin-top: 1px;
}
.setup-item.done .setup-check { background: var(--green); border-color: var(--green); color: #fff; }
.setup-item.done .setup-label { color: var(--muted); text-decoration: line-through; }
.setup-label { font-weight: 600; font-size: 14.5px; }
.setup-hint { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.setup-go { margin-left: auto; flex: none; }

.setup-toggle { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.setup-toggle .switch { transform: scale(.85); transform-origin: right center; }

.setup-done {
  display: flex; align-items: center; gap: 12px; padding: 14px; margin-bottom: 6px;
  background: var(--green-bg); border: 1px solid #86efac; border-radius: 12px; color: #14532d;
  font-weight: 600; font-size: 14px;
}
.setup-done .big { font-size: 26px; }

/* ------------------------------ Channels -------------------------------- */
.chan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }
.chan {
  display: flex; gap: 11px; align-items: flex-start; padding: 14px; border: 1.5px solid var(--line);
  border-radius: 12px; cursor: pointer; transition: .15s; background: #fff;
}
.chan:hover { border-color: #cbd5e1; }
.chan:has(input:checked) { border-color: var(--primary); background: var(--primary-50); }
.chan input { margin-top: 3px; flex: none; }
.chan-ico { font-size: 20px; line-height: 1.2; }
.chan-body { display: block; font-size: 13px; color: var(--muted); line-height: 1.45; }
.chan-body b { display: block; color: var(--ink); font-size: 14px; margin-bottom: 2px; }
.chan-body small { display: block; }

/* ------------------------------ Staff screens -------------------------- */
.staff-screens { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.staff-screen {
  border: 1px solid var(--line); border-radius: 12px; padding: 16px; display: flex; gap: 14px; align-items: flex-start;
}
.staff-screen img { width: 104px; flex: none; border-radius: 8px; }
.staff-screen .sc-title { font-weight: 700; font-size: 15px; display: flex; align-items: center; gap: 7px; }
.staff-screen .sc-url {
  font-size: 12.5px; color: var(--primary-700); word-break: break-all; margin: 6px 0 10px;
  background: var(--primary-50); padding: 5px 8px; border-radius: 6px; display: inline-block;
}
.staff-screen .sc-hint { font-size: 12px; color: var(--muted); margin-top: 8px; }

.role-pill { font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; text-transform: capitalize; }
.role-pill.owner { background: var(--violet-bg); color: var(--violet); }
.role-pill.kitchen { background: var(--amber-bg); color: var(--amber); }
.role-pill.cashier { background: var(--blue-bg); color: var(--blue); }

/* --------------------------- Live service extras ------------------------ */
.heat { display: flex; align-items: flex-end; gap: 5px; height: 126px; padding: 10px 2px 0; }
.heat .col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 5px; height: 100%; }
.heat .bar {
  width: 100%; border-radius: 6px 6px 3px 3px; min-height: 3px;
  background: linear-gradient(180deg, #2dd4bf, #0d9488); opacity: .9;
}
.heat .bar.zero { background: var(--line); opacity: .5; }
.heat .h { font-size: 9px; color: var(--muted); font-weight: 600; line-height: 1; }
.heat .n { font-size: 10px; font-weight: 800; color: var(--ink-2); line-height: 1; }

.score-ring {
  --score: 0;
  width: 92px; height: 92px; border-radius: 50%; flex: none;
  background: conic-gradient(var(--primary) calc(var(--score) * 1%), var(--line) 0);
  display: grid; place-items: center; position: relative;
}
.score-ring::after {
  content: ''; position: absolute; inset: 7px; border-radius: 50%; background: var(--card);
}
.score-ring > div { position: relative; z-index: 1; text-align: center; line-height: 1.05; }
.score-ring b { font-size: 21px; font-weight: 800; letter-spacing: -.03em; display: block; }
.score-ring span { font-size: 9px; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; font-weight: 700; }

.fb-row { display: flex; gap: 11px; align-items: flex-start; padding: 11px 18px; border-bottom: 1px solid var(--line); }
.fb-row:last-child { border-bottom: none; }
.fb-emoji { font-size: 23px; line-height: 1; flex: none; }
.fb-body { flex: 1; min-width: 0; }
.fb-body .who { font-size: 12.5px; font-weight: 700; }
.fb-body .note { font-size: 12.5px; color: var(--muted); margin-top: 2px; word-break: break-word; }
.fb-body .when { font-size: 11px; color: var(--muted-2); margin-top: 3px; }

.avg-big { display: flex; align-items: center; gap: 12px; }
.avg-big .n { font-size: 34px; font-weight: 800; letter-spacing: -.04em; line-height: 1; }
.avg-big .stars { font-size: 15px; letter-spacing: 1px; color: #f59e0b; }

/* Floor status pills on the tables screen */
.floor-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; border-radius: 999px;
  font-size: 11.5px; font-weight: 700; border: 1px solid var(--line); background: var(--card); color: var(--muted);
}
.floor-pill::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .6; }
.floor-pill.busy { background: var(--amber-bg); border-color: rgba(245, 158, 11, .35); color: var(--amber); }
.floor-pill.due { background: var(--green-bg); border-color: rgba(22, 163, 74, .3); color: var(--green); }
.floor-pill.free { background: var(--primary-50); border-color: var(--primary-100); color: var(--primary-700); }

/* Floor map — one tile per table, coloured by live occupancy */
.floor-map { display: grid; grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); gap: 10px; }
.floor-tile {
  border: 1px solid var(--line); border-radius: 12px; padding: 10px 11px;
  background: var(--card); transition: .15s;
}
.floor-tile b { display: block; font-size: 13px; letter-spacing: -.01em; }
.floor-tile span { display: block; font-size: 11px; color: var(--muted); margin-top: 1px; }
.floor-tile .amt { font-size: 12px; font-weight: 800; margin-top: 3px; color: var(--ink); }
.floor-tile.free { background: var(--primary-50); border-color: var(--primary-100); }
.floor-tile.busy { background: var(--amber-bg); border-color: rgba(245, 158, 11, .38); }
.floor-tile.busy b { color: var(--amber); }
.floor-tile.off { opacity: .55; }

/* Branded table tent (print) */
.tent-brand { display: flex; align-items: center; justify-content: center; gap: 6px; font-weight: 800; letter-spacing: -.02em; }
.tent-brand img { width: 20px; height: 20px; }
.tent-venue { font-size: 10.5px; color: #64748b; text-align: center; margin-top: 2px; }
.tent-meta { font-size: 9px; color: #475569; text-align: center; margin-top: 6px; line-height: 1.5; }

/* Menu item photo preview inside the item modal */
.img-preview {
  margin-top: 9px; width: 100%; height: 108px; border-radius: 12px; overflow: hidden;
  border: 1px dashed var(--line-strong); background: var(--bg);
  display: grid; place-items: center;
}
.img-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.img-preview.empty span { font-size: 11.5px; color: var(--muted-2); padding: 0 12px; text-align: center; }

/* ============================== Dark theme ============================== */
[data-theme="dark"] body { background: var(--bg); }
[data-theme="dark"] .qr-card,
[data-theme="dark"] .chan { background: var(--card); }
[data-theme="dark"] .chan:hover { border-color: #3a4b68; }
[data-theme="dark"] .cat-head { background: linear-gradient(180deg, #111e31, var(--card)); }
[data-theme="dark"] .live-row:hover { background: rgba(255, 255, 255, .035); }
[data-theme="dark"] .setup-done { border-color: rgba(74, 222, 128, .35); color: #bbf7d0; }
[data-theme="dark"] .setup-check { border-color: var(--line-strong); }
[data-theme="dark"] .staff-screen .sc-url { color: #5eead4; }
[data-theme="dark"] .avg-big .stars { color: #fbbf24; }

@media print {
  .qr-card { background: #fff !important; color: #0b1220 !important; }
  .qr-card .rname, .qr-card .hint, .tent-venue, .tent-meta { color: #475569 !important; }
  .tent-brand { color: #0b1220 !important; }
}
