/* ═══════════════════════════════════════════
   GR Tables — Mesa Visual Manager
   GR Diseño Digital v1.7.1
═══════════════════════════════════════════ */

/* ── Mesa canvas ── */
.grp-tables-toolbar { display:flex; gap:10px; align-items:center; flex-wrap:wrap; margin-bottom:16px; }
.grp-tables-stats   { display:flex; gap:16px; font-size:.82rem; color:var(--grp-muted); }
.grp-tables-stats span strong { color:var(--grp-text); }

.grp-tables-canvas-wrap {
  position:relative; background:rgba(255,255,255,.02);
  border:1px dashed var(--grp-border); border-radius:16px;
  min-height:420px; overflow:auto; max-height:600px;
}
.grp-tables-canvas { width:100%; min-width:700px; position:relative; }

/* ── Individual table card ── */
.grp-table-card {
  position:absolute; cursor:grab; user-select:none;
  background:var(--grp-bg,rgba(30,30,50,.95));
  border:1.5px solid var(--grp-border); border-radius:16px;
  padding:14px; width:180px;
  transition:box-shadow .2s, border-color .2s;
  box-shadow: 0 2px 12px rgba(0,0,0,.3);
}
.grp-table-card:active { cursor:grabbing; }
.grp-table-card:hover  { border-color:var(--grp-accent); box-shadow:0 4px 20px rgba(0,0,0,.5); }

.grp-table-card-header { display:flex; justify-content:space-between; align-items:center; margin-bottom:10px; }
.grp-table-card-name   { font-size:.88rem; font-weight:700; color:var(--grp-text); flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.grp-table-card-actions { display:flex; gap:4px; }
.grp-table-card-actions button { background:none; border:none; cursor:pointer; padding:2px 4px; color:var(--grp-muted); font-size:.85rem; border-radius:4px; }
.grp-table-card-actions button:hover { color:var(--grp-text); background:rgba(255,255,255,.07); }

/* ── SVG seat visualization ── */
.grp-table-svg-wrap { display:flex; justify-content:center; margin-bottom:8px; }
.grp-table-seat-free     { fill:rgba(255,255,255,.12); stroke:rgba(255,255,255,.2); stroke-width:1; }
.grp-table-seat-occupied { fill:#22c55e; stroke:#16a34a; stroke-width:1; }
.grp-table-seat-icon     { fill:rgba(255,255,255,.6); }
.grp-table-body-round    { fill:rgba(255,255,255,.06); stroke:rgba(255,255,255,.15); stroke-width:1.5; }
.grp-table-body-rect     { fill:rgba(255,255,255,.06); stroke:rgba(255,255,255,.15); stroke-width:1.5; rx:6; }
.grp-table-body-sq       { fill:rgba(255,255,255,.06); stroke:rgba(255,255,255,.15); stroke-width:1.5; }

.grp-table-card-info { font-size:.75rem; color:var(--grp-muted); display:flex; justify-content:space-between; }
.grp-table-card-info span { color:var(--grp-text); font-weight:600; }

.grp-table-guest-pill {
  display:inline-block; background:rgba(255,255,255,.07);
  border-radius:6px; padding:2px 8px; font-size:.7rem;
  color:var(--grp-muted); margin:1px; max-width:100%; overflow:hidden;
  text-overflow:ellipsis; white-space:nowrap;
}
.grp-table-guests-list { margin-top:6px; max-height:60px; overflow:hidden; }

/* ── List view ── */
.grp-tables-list-view { display:flex; flex-direction:column; gap:0; }
.grp-tables-list-row  {
  display:grid; grid-template-columns:40px 1fr 80px 80px 80px 100px;
  gap:12px; align-items:center; padding:10px 14px;
  border-bottom:1px solid var(--grp-border); font-size:.84rem;
}
.grp-tables-list-row:hover { background:rgba(255,255,255,.02); }
.grp-tables-list-header { font-size:.72rem; font-weight:700; color:var(--grp-muted); text-transform:uppercase; }

/* ── Checkin panel ── */
.grp-checkin-panel { display:flex; flex-direction:column; gap:20px; }
.grp-checkin-stats-row { display:grid; grid-template-columns:repeat(3,1fr); gap:12px; }
.grp-checkin-stat {
  background:rgba(255,255,255,.04); border:1px solid var(--grp-border);
  border-radius:14px; padding:16px; text-align:center;
}
.grp-checkin-stat-num  { font-size:2rem; font-weight:700; }
.grp-checkin-stat-lbl  { font-size:.75rem; color:var(--grp-muted); margin-top:2px; }
.grp-checkin-num-green  { color:#22c55e; }
.grp-checkin-num-amber  { color:#f59e0b; }
.grp-checkin-num-blue   { color:#60a5fa; }

.grp-checkin-search { display:flex; gap:10px; }
.grp-checkin-search input { flex:1; }

.grp-checkin-scanner { 
  background:rgba(255,255,255,.03); border:1px solid var(--grp-border);
  border-radius:14px; padding:20px; text-align:center;
}
.grp-checkin-result {
  border-radius:12px; padding:16px; margin-top:12px;
  display:none;
}
.grp-checkin-result.found  { background:rgba(34,197,94,.1);  border:1px solid rgba(34,197,94,.3); }
.grp-checkin-result.already { background:rgba(245,158,11,.1); border:1px solid rgba(245,158,11,.3); }
.grp-checkin-result.notfound { background:rgba(239,68,68,.1); border:1px solid rgba(239,68,68,.3); }

.grp-checkin-list { display:flex; flex-direction:column; gap:0; max-height:380px; overflow-y:auto; }
.grp-checkin-row  {
  display:flex; justify-content:space-between; align-items:center;
  padding:10px 0; border-bottom:1px solid var(--grp-border); font-size:.84rem;
}
.grp-checkin-badge {
  display:inline-block; font-size:.72rem; padding:2px 10px;
  border-radius:10px; font-weight:700;
}
.grp-checkin-badge.in     { background:rgba(34,197,94,.15);  color:#22c55e; }
.grp-checkin-badge.pending { background:rgba(245,158,11,.15); color:#f59e0b; }

/* ── QR code display ── */
.grp-qr-wrap { text-align:center; padding:16px; }
.grp-qr-wrap img { border-radius:8px; }

/* ── Card-group view (Variant B) ── */
.grp-tables-card-grid {
  display:grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap:16px; padding:4px;
}
.grp-table-card-group {
  background:rgba(255,255,255,.05);
  border:1px solid var(--grp-border);
  border-radius:16px; padding:16px;
  display:flex; flex-direction:column; gap:10px;
  transition:border-color .2s, box-shadow .2s;
}
.grp-table-card-group:hover {
  border-color:var(--grp-accent);
  box-shadow:0 4px 20px rgba(0,0,0,.3);
}
.grp-tcg-header { display:flex; flex-direction:column; gap:6px; }
.grp-tcg-title  { font-size:.95rem; font-weight:700; color:var(--grp-text); }
.grp-tcg-meta   { display:flex; gap:8px; align-items:center; font-size:.78rem; color:var(--grp-muted); }
.grp-tcg-seats  { font-weight:600; color:var(--grp-text); }
.grp-tcg-status { font-weight:700; font-size:.72rem; }
.grp-tcg-actions { display:flex; gap:6px; margin-top:4px; }
.grp-tcg-btn-assign {
  flex:1; padding:5px 8px; font-size:.75rem; font-weight:600;
  background:var(--grp-accent); color:#fff; border:none;
  border-radius:8px; cursor:pointer; transition:opacity .2s;
}
.grp-tcg-btn-assign:hover { opacity:.85; }
.grp-tcg-btn-edit, .grp-tcg-btn-del {
  padding:5px 8px; background:rgba(255,255,255,.07);
  border:1px solid var(--grp-border); border-radius:8px;
  cursor:pointer; font-size:.82rem; transition:background .2s;
}
.grp-tcg-btn-edit:hover, .grp-tcg-btn-del:hover { background:rgba(255,255,255,.12); }

/* Seat dots */
.grp-tcg-seats-visual {
  display:flex; flex-wrap:wrap; gap:4px;
}
.grp-tcg-dot {
  width:14px; height:14px; border-radius:50%;
  background:rgba(255,255,255,.12);
  border:1px solid rgba(255,255,255,.2);
  transition:background .2s;
}
.grp-tcg-dot.confirmed { background:#22c55e; border-color:#16a34a; }
.grp-tcg-dot.pending   { background:#f59e0b; border-color:#d97706; }
.grp-tcg-dot.declined  { background:#ef4444; border-color:#dc2626; }

/* Guest list in card */
.grp-tcg-guests {
  display:flex; flex-wrap:wrap; gap:4px;
  min-height:28px;
}
.grp-tcg-guest {
  background:rgba(255,255,255,.08); border-radius:6px;
  padding:2px 8px; font-size:.73rem; color:var(--grp-muted);
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
  max-width:100%;
}

/* Progress bar */
.grp-tcg-progress {
  height:4px; background:rgba(255,255,255,.1);
  border-radius:2px; overflow:hidden;
}
.grp-tcg-bar {
  height:100%; border-radius:2px;
  transition:width .4s ease;
}

@media (max-width:500px) {
  .grp-tables-card-grid { grid-template-columns:1fr; }
}
