/* styles/admin.css */
.topbar{
  display:flex; align-items:center; justify-content:space-between;
  padding:12px 16px; border-bottom:1px solid var(--line);
  background:linear-gradient(180deg, #0e1930, #0b1220);
  position:sticky; top:0; z-index:10;
}
.brand{ font-weight:800; letter-spacing:.5px; }
.muted{ color:var(--muted); font-weight:600; }
.topbar-right{ display:flex; gap:10px; align-items:center; }

.layout{ display:flex; min-height:calc(100vh - 56px); }
.sidebar{
  width:260px; border-right:1px solid var(--line);
  padding:14px; background:#0b1325;
}
.sidebar-title{ color:var(--muted); font-size:12px; margin-bottom:10px; text-transform:uppercase; }
.navlink{
  display:block; padding:10px 12px; border-radius:12px;
  border:1px solid transparent; margin-bottom:8px;
  background:rgba(255,255,255,.02);
}
.navlink.active{ border-color:var(--line); background:rgba(37,99,235,.08); }
.sidebar-foot{ margin-top:16px; color:var(--muted); font-size:12px; }

.content{ flex:1; padding:16px; }
.card{
  background:var(--card); border:1px solid var(--line);
  border-radius:var(--radius); padding:var(--pad);
  box-shadow:var(--shadow); max-width:1100px;
}
h1{ margin:0 0 10px 0; font-size:20px; }
h2{ margin:12px 0 8px 0; font-size:16px; }
.hint{ color:var(--muted); font-size:12px; margin-top:10px; }
.row{ display:flex; flex-direction:column; gap:6px; margin:10px 0; }
.grid2{ display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.grid3{ display:grid; grid-template-columns:1fr 1fr 1fr; gap:12px; }

.input,.select{
  padding:10px 12px; border-radius:12px; border:1px solid var(--line);
  background:#0b1325; color:var(--text); outline:none;
}
.btn{
  padding:10px 12px; border-radius:12px; border:1px solid var(--line);
  background:var(--btn); color:var(--text); cursor:pointer;
}
.btn-primary{ background:rgba(37,99,235,.25); border-color:rgba(37,99,235,.45); }
.btn-danger{ background:rgba(220,38,38,.22); border-color:rgba(220,38,38,.45); }
.badge{
  padding:6px 10px; border-radius:999px; border:1px solid var(--line);
  background:rgba(255,255,255,.03);
}
.table{ width:100%; border-collapse:collapse; border-radius:12px; overflow:hidden; }
.table th,.table td{ border-bottom:1px solid var(--line); padding:8px 10px; text-align:left; }
.table thead th{ color:var(--muted); font-weight:700; font-size:12px; }

.canvasWrap{ margin-top:12px; }
.canvas{
  position:relative; border:1px dashed rgba(148,163,184,.35);
  border-radius:14px; background:rgba(255,255,255,.02); overflow:hidden;
}
.tableBox{
  position:absolute; border-radius:14px;
  border:1px solid rgba(148,163,184,.35); background:rgba(255,255,255,.04);
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  user-select:none; touch-action:none; cursor:grab;
}
.tableBox.drag{ cursor:grabbing; outline:2px solid rgba(37,99,235,.35); }
.tbLabel{ font-weight:800; font-size:14px; }
.tbSeats{ color:var(--muted); font-size:11px; margin-top:2px; }

.gridWrap{ margin-top:12px; }
.grid{
  display:grid;
  grid-template-columns: repeat(var(--cols), 1fr);
  grid-template-rows: repeat(var(--rows), 40px);
  gap:6px; padding:10px;
  border:1px dashed rgba(148,163,184,.35);
  border-radius:14px; background:rgba(255,255,255,.02);
}
.gridTable{
  border-radius:14px; border:1px solid rgba(148,163,184,.35);
  background:rgba(255,255,255,.04);
  display:flex; align-items:center; justify-content:center;
  cursor:pointer;
}
.gtLabel{ font-weight:800; }

@media (max-width: 900px){
  .layout{ flex-direction:column; }
  .sidebar{ width:auto; display:flex; gap:8px; overflow:auto; }
  .navlink{ white-space:nowrap; }
  .grid2,.grid3{ grid-template-columns:1fr; }
}

/* ---------- Modal ---------- */
.tfModal.hidden{ display:none; }
.tfModal{
  position:fixed; inset:0; z-index:9999;
  display:flex; align-items:center; justify-content:center;
}
.tfModalBackdrop{
  position:absolute; inset:0;
  background:rgba(0,0,0,.55);
}
.tfModalCard{
  position:relative;
  width:min(900px, calc(100vw - 24px));
  background:var(--card);
  border:1px solid var(--line);
  border-radius:18px;
  box-shadow:var(--shadow);
  padding:14px;
}
.tfModalHeader{
  display:flex; align-items:center; justify-content:space-between;
  margin-bottom:10px;
}
.tfModalTitle{ font-weight:900; }
.tfModalClose{ padding:6px 10px; border-radius:10px; }
.tfModalBody{ margin-top:8px; }
.tfModalFooter{
  display:flex; gap:10px; align-items:center;
  margin-top:12px;
  
  /* Drag handle inside free-layout tables */
.tbHandle{
  position:absolute;
  top:6px;
  left:8px;
  width:26px;
  height:22px;
  border-radius:10px;
  border:1px solid rgba(148,163,184,.35);
  background:rgba(0,0,0,.18);
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:900;
  color:rgba(229,231,235,.9);
  cursor:grab;
  user-select:none;
}
.tableBox{ position:absolute; }
.tableBox.drag .tbHandle{ cursor:grabbing; }

/* --- FIX: handle drag --- */
.tableBox{
  position:absolute;
  position:relative; /* ✅ ΑΥΤΟ λείπει */
}

.tbHandle{
  position:absolute;
  top:6px;
  left:8px;
  width:26px;
  height:22px;
  border-radius:10px;
  border:1px solid rgba(148,163,184,.35);
  background:rgba(0,0,0,.18);
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:900;
  color:rgba(229,231,235,.9);
  cursor:grab;
  user-select:none;
  touch-action:none; /* ✅ βοηθάει σε pointer events */
  z-index:5;         /* ✅ να είναι πάνω από το box */
}

.tableBox.drag .tbHandle{ cursor:grabbing; }


}
