/* ═══════════════════════════════════════════════════════════
   PIXEL BLACK RESTAURANT ERP — TABLES CSS
   Floor view, table cards, stats bar
   ═══════════════════════════════════════════════════════════ */

/* ── SHELL ── */
.tables-shell {
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--header-h) - 38px);
  overflow: hidden;
}

/* ── STATS BAR ── */
.stats-bar {
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 0 16px;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg);
  min-width: 120px;
  transition: 0.15s;
}
.stat-card:hover { border-color: var(--border-md); }

.stat-icon { font-size: 1.2rem; }
.stat-info { display: flex; flex-direction: column; }
.stat-value { font-size: 1.1rem; font-weight: 800; line-height: 1; }
.stat-label { font-size: 0.6rem; font-weight: 600; color: var(--t3); text-transform: uppercase; letter-spacing: 0.4px; margin-top: 1px; }

.stat-card.free    .stat-value { color: var(--green); }
.stat-card.occupied .stat-value { color: var(--orange); }
.stat-card.reserved .stat-value { color: var(--blue); }
.stat-card.billed   .stat-value { color: var(--red); }

.stats-actions { margin-left: auto; display: flex; gap: 7px; }

/* ── FLOOR AREA ── */
.floor-area {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

/* ── FLOOR SECTION ── */
.floor-section { margin-bottom: 24px; }
.floor-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.floor-section-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--t2);
  display: flex;
  align-items: center;
  gap: 6px;
}
.floor-section-title::before {
  content: '';
  display: inline-block;
  width: 3px; height: 14px;
  background: var(--green);
  border-radius: 2px;
}

/* ── TABLE GRID ── */
.floor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}

/* ── TABLE CARD ── */
.tbl-card {
  background: #fff;
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 12px;
  cursor: pointer;
  transition: all 0.18s;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  box-shadow: var(--shadow-sm);
  user-select: none;
}

.tbl-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.tbl-card:active { transform: scale(0.97); }

/* Status variants */
.tbl-card.free {
  border-color: rgba(0,166,81,0.3);
  background: var(--green-lt);
}
.tbl-card.free .tbl-num { color: var(--green); }
.tbl-card.free:hover { border-color: var(--green); box-shadow: 0 6px 20px rgba(0,166,81,0.15); }

.tbl-card.occupied {
  border-color: rgba(249,115,22,0.35);
  background: var(--orange-lt);
}
.tbl-card.occupied .tbl-num { color: var(--orange); }
.tbl-card.occupied:hover { border-color: var(--orange); box-shadow: 0 6px 20px rgba(249,115,22,0.15); }

.tbl-card.reserved {
  border-color: rgba(59,130,246,0.3);
  background: var(--blue-lt);
}
.tbl-card.reserved .tbl-num { color: var(--blue); }
.tbl-card.reserved:hover { border-color: var(--blue); box-shadow: 0 6px 20px rgba(59,130,246,0.15); }

.tbl-card.billed {
  border-color: rgba(239,68,68,0.35);
  background: var(--red-lt);
}
.tbl-card.billed .tbl-num { color: var(--red); }
.tbl-card.billed:hover { border-color: var(--red); box-shadow: 0 6px 20px rgba(239,68,68,0.15); }

/* Status dot (top right) */
.tbl-status-dot {
  position: absolute;
  top: 10px; right: 10px;
  width: 9px; height: 9px;
  border-radius: 50%;
}
.tbl-card.free      .tbl-status-dot { background: var(--green);  box-shadow: 0 0 6px rgba(0,166,81,0.5); }
.tbl-card.occupied  .tbl-status-dot { background: var(--orange); box-shadow: 0 0 6px rgba(249,115,22,0.5); animation: blink 1.5s infinite; }
.tbl-card.reserved  .tbl-status-dot { background: var(--blue);   box-shadow: 0 0 6px rgba(59,130,246,0.5); }
.tbl-card.billed    .tbl-status-dot { background: var(--red);    box-shadow: 0 0 6px rgba(239,68,68,0.5); animation: blink 0.8s infinite; }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0.4} }

/* Cap badge (top left) */
.tbl-cap {
  position: absolute;
  top: 8px; left: 8px;
  font-size: 0.58rem; font-weight: 700; color: var(--t4);
  display: flex; align-items: center; gap: 2px;
}

.tbl-icon { font-size: 2.4rem; margin: 4px 0 8px; }
.tbl-num  { font-size: 1.1rem; font-weight: 900; margin-bottom: 3px; }

.tbl-badge {
  font-size: 0.62rem; font-weight: 700;
  padding: 2px 8px; border-radius: 99px; margin-bottom: 4px;
}
.tbl-card.free     .tbl-badge { background: var(--green-dim);  color: var(--green); }
.tbl-card.occupied .tbl-badge { background: var(--orange-dim); color: var(--orange); }
.tbl-card.reserved .tbl-badge { background: var(--blue-dim);   color: var(--blue); }
.tbl-card.billed   .tbl-badge { background: var(--red-dim);    color: var(--red); }

.tbl-meta { font-size: 0.64rem; color: var(--t3); line-height: 1.4; }
.tbl-amount { font-size: 0.78rem; font-weight: 800; margin-top: 6px; color: var(--t1); }

/* Actions row on hover */
.tbl-actions {
  display: flex;
  gap: 4px;
  margin-top: 10px;
  width: 100%;
}
.tbl-action-btn {
  flex: 1;
  height: 24px;
  border-radius: 5px;
  font-size: 0.6rem;
  font-weight: 700;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--t2);
  cursor: pointer;
  transition: 0.12s;
  display: flex; align-items: center; justify-content: center;
}
.tbl-action-btn:hover { background: var(--green); border-color: var(--green); color: #fff; }
.tbl-action-btn.danger:hover { background: var(--red); border-color: var(--red); }

/* ── ADD TABLE CARD ── */
.tbl-add-card {
  background: var(--bg);
  border: 2px dashed var(--border-md);
  border-radius: var(--radius-lg);
  padding: 14px 12px;
  cursor: pointer;
  transition: all 0.18s;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 140px;
  color: var(--t4);
  gap: 6px;
}
.tbl-add-card:hover {
  border-color: var(--green);
  color: var(--green);
  background: var(--green-lt);
}
.tbl-add-icon { font-size: 1.8rem; opacity: 0.5; }
.tbl-add-txt  { font-size: 0.72rem; font-weight: 600; }

/* ── TABLE DETAIL MODAL ── */
.tbl-modal-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.tbl-modal-icon {
  width: 52px; height: 52px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem;
}
.tbl-modal-icon.free     { background: var(--green-lt); }
.tbl-modal-icon.occupied { background: var(--orange-lt); }
.tbl-modal-icon.billed   { background: var(--red-lt); }

.tbl-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}
.tbl-detail-item {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 10px 12px;
}
.tdi-label { font-size: 0.6rem; font-weight: 700; color: var(--t3); text-transform: uppercase; letter-spacing: 0.4px; margin-bottom: 3px; }
.tdi-val   { font-size: 0.9rem; font-weight: 800; color: var(--t1); }

.tbl-modal-actions {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.tbl-modal-btn {
  width: 100%;
  height: 38px;
  border-radius: var(--radius);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
}
.tbl-modal-btn.go    { background: var(--green); color: #fff; box-shadow: 0 3px 10px rgba(0,166,81,0.25); }
.tbl-modal-btn.go:hover { background: var(--green-dk); }
.tbl-modal-btn.ghost { background: var(--bg); border: 1px solid var(--border); color: var(--t2); }
.tbl-modal-btn.ghost:hover { border-color: var(--green); color: var(--green); }
.tbl-modal-btn.danger{ background: var(--red-lt); border: 1px solid var(--red); color: var(--red); }
.tbl-modal-btn.danger:hover { background: var(--red); color: #fff; }
